Solved

Which One of the Following Statements Is Correct for the Given

Question 10

Multiple Choice

Which one of the following statements is correct for the given code snippet?
Int[] number = new int[3]; // Line 1
Number[3] = 5; // Line 2


A) Line 2 declares and initializes an array of three elements with value 5.
B) Line 2 causes a bounds error because 3 is an invalid index number.
C) Line 2 initializes the third element of the array with value 5.
D) Line 2 initializes all the elements of the array with value 5.

Correct Answer:

verifed

Verified

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

Related Questions