| preferred AP College board partner for AP classes
AP Computer Science A/Unit 8: 2D Array
Start Practice TestPractice Test
About Exam
easy Solved by 11 students
2D Array Traversal and Modification
< Prev
Next >

Consider the following code segment. What is printed when the code segment is executed?

int[][] matrix = { {1, 2}, {3, 4} };
for (int i = 0; i < matrix.length; i++) {
    for (int j = 0; j < matrix[i].length; j++) {
        matrix[i][j] += 1;
    }
}
System.out.println(matrix[1][1]);
A

6

B

1

C

4

D

5

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1ahsan4810522 0m 00s 200
#2y.seong202702 3m 49s -249
#3bommasam00025 7m 50s -300
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy