Which one of the following Java statements assign 100 to the last element of a 3 × 3 array?

ICSE Class 10 Computer Applications PYQ · 2025 Improvement · Section A

1(xvii)1 Mark · 2025 · Section A · 2025 Improvement

Which one of the following Java statements assign 100 to the last element of a 3 × 3 array?

Show SolutionHide Solution↓

x[2][2]=100;

Reason — In Java, array indexing starts from 0, so a 3 × 3 array has valid row and column indices 0, 1, and 2. The last element is at row index 2 and column index 2, so x[2][2] = 100; correctly assigns the value 100 to that element.

← Previous questionNext question →

Browse the free Computer Applications sample bank