If we have a 2D array int[][] arr, the expression arr[i] refers to the __________.
- an error
- entire array
- ith column of the array
- ith row of the array
In a 2D array in Java, arr[i] refers to the ith row of the array. This is because a 2D array is essentially an array of arrays, where each element arr[i] is itself an array representing a row. Accessing arr[i] gives you the entire row at index i.
Loading...
Related Quiz
- How can you read an 8-bit byte from a file using byte streams in Java?
- What is the major drawback of Linear Search compared to other searching algorithms?
- Which of the following is a key characteristic of a lambda expression in Java?
- What is the effect of calling the yield() method in a thread?
- Deadlock occurs when two or more threads are blocked forever, each waiting for the other to ________.