Oracle
1Z0-809 · Question #184
1Z0-809 Question #184: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #184. The question stem and answer options stay visible for context.
Question
Given the code fragment:
String shirts[][] = new String[2][2];
shirts[0][0] = "red";
shirts[0][1] = "blue";
shirts[1][0] = "small";
shirts[1][1] = "medium";
Which code fragment prints red: blue: small1: medium: ?
Options
- Afor (int idx = 1; idx < 2; idx++) { for (int idx1 = 0; idx1 < 2; idx1++) { System.out.print (shirts[idx] [idx1] + ":"); } }
- Bfor (int idx = 0; idx < 2; idx++) { for (int idx1 = 0; idx1 < 2; idx1++) { System.out.print (shirts[idx] [idx1] + ":"); } } idx++;
- Cfor (String s : colors) { for (String s : sizes) { System.out.print (s + ":"); } }
- Dfor (int idx = 0; index < 2; ++index) { for (int idx1 = 0; idx1 < 2; idx1++) { System.out.print (shirts[idx] [idx] + ":"); } }
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.