What value is stored at arr[1][2] after executing the following code snippet: int[][] arr = {{1,2,3}, {4,5,6}, {7,8,9}};?
- 3
- 6
- 8
- 9
The given code initializes a 2D array arr. arr[1] represents the second row (index 1), and arr[1][2] represents the third element in that row, which is 8. So, 8 is stored at arr[1][2].
Loading...
Related Quiz
- How many else if blocks can be used after an if block?
- Which of the following is an invalid variable name in Java?
- What is the impact of using a SocketChannel in non-blocking mode over traditional blocking I/O socket communication?
- How does the BufferedOutputStream class work in Java when connected to a file output byte stream?
- The method ________ is used to execute SQL for DDL statements using JDBC.