Solved

Look at the Following Code Sample That Creates an Array

Question 31

Multiple Choice

Look at the following code sample that creates an array of Pet structure objects: struct Pet
{
Public string name;
Public int age;
Public string type;
}
Const int SIZE = 4;
Pet[] cats = new Pet[SIZE];
Which one of the following statements assigns the string "Pickles" to the name member of cats[2]?


A) "Pickles" = cats[2];
B) cats[2].name = "Pickles";
C) cats.name[2] = "Pickles";
D) cats[2].name("Pickles") ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents