| preferred AP College board partner for AP classes
AP Computer Science A/Unit 8: 2D Array
Start Practice TestPractice Test
Share
About Exam
medium Solved by 4 students
2D Array Column-Major Traversal
< Prev
Next >

Consider the following code segment:

String[][] data = {
    {"AA", "BB"},
    {"CC", "DD"},
    {"EE", "FF"},
    {"GG", "HH"}
};
for (int col = 0; col < data[0].length; col++) {
    for (int row = 0; row < data.length; row++) {
        System.out.print(data[row][col] + " ");
    }
    System.out.println();
}

What is printed as a result of executing this code segment?

A

CC AA
DD BB
FF EE
HH GG

B

AA CC EE GG
BB DD FF HH

C

BB FF DD HH
AA EE CC GG

D

AA CC EE GG
HH FF DD BB

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

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy