Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 8: 2D Array
Start Practice TestPractice Test
About Exam
medium Solved by 1 students

2D Array Nested Loop Traversal

< Prev
Next >

What is printed when the following code segment is executed?

String[][] letters = {{"A", "B", "C", "D"},
                      {"E", "F", "G", "H"},
                      {"I", "J", "K", "L"}};

for (int col = 1; col < letters[0].length; col++)
{
    for (int row = 1; row < letters.length; row++)
    {
        System.out.print(letters[row][col] + " ");
    }
    System.out.println();
}
A

F J
G K
H L

B

F G H
J K L

C

B F J
C G K
D H L

D

A E I
F J
K

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

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

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