Suppose that you declare a class named Furniture that contains a string field named woodType and a conventionally named property with a get accessor. When you declare an array of 200 Furniture objects named myChairs, which of the following accesses the last Furniture object's wood type?a. Furniture.Get(woodType[199])b. myChairs[199].WoodType()c. myChairs.WoodType[199]d. myChairs[199].WoodType

Respuesta :

myChairs[199].WoodType is the following accesses the last Furniture object's wood type

d. myChairs[199].WoodType

Explanation:

An array often has the size range of [0- n-1] where n is number of cell for array. For example, when the array has a size of 5, its index starts from 0 and ends at n-1 ie 4.

So according to the question, the array myChairs is an array of objects declared from the class Furniture. Its index starts from 0 and the last object is at 199. So to access the last object’s WoodType, the following accesses it:

myChairs[199].WoodType.

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE