QuestionQ166

VerifiedData Manipulation

The arrayOfPointsGainedByParticipant Object array is created and initialized with the values \{“7”, “4”, “1”\}. At runtime, what value and data type are returned by arrayOfPointsGainedByParticipant(1)?

Explanation

Array indexing starts at zero, so index 1 retrieves the second element, which is the string value "4". The element’s runtime type is String, because it was initialized from a quoted string literal.

Community Discussion

No comments yet. Be the first to start the discussion!