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 use 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.
Which will legally declare, construct, and initialize an array?
Review the verified answer and explanation for this DemoPaper-Pakistan past-paper question on CampusFin.
Question context
This question is part of ☕ Java Programming within the broader 💻 Programming subject and appears in the DemoPaper-Pakistan preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.