Oracle
1Z0-851 · Question #16
Given: class Alligator { public static void main(String[] args) { int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}}; int [][]y = x; System.out.println(y[2][1]); } } What is the result?
The correct answer is E. 7. See the full explanation below for the reasoning.
Question
Given: class Alligator { public static void main(String[] args) { int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}}; int [][]y = x; System.out.println(y[2][1]); } } What is the result?
Options
- A2
- B3
- C4
- D6
- E7
- FCompilation fails.
How the community answered
(55 responses)- A4% (2)
- B2% (1)
- D9% (5)
- E84% (46)
- F2% (1)
Community Discussion
No community discussion yet for this question.