ExamVeda
Login
Home
This question belongs to Java Program Array
Array
?

Which will legally declare, construct, and initialize an array?

Answer & Solution
Correct Answer: Option D

The only legal array declaration and assignment statement is Option D
Option A is wrong because it initializes an int array with String literals.
Option B is wrong because it uses something other than curly braces for the initialization.
Option C is wrong because it provides initial values for only one dimension, although the declared array is a two-dimensional array.

Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.