/* C */
for (String [] c : shirts) {
for (String s : c) {
System.out.print(s + ":");
}
}
/* D
System.out.println();
for (int index = 0; index <= 2; ) {
for (int idx = 0; idx <= 2; ) {
System.out.print(shirts[index][idx] + ":" );
idx++;
}
index++;
}
*/
}
only C
D is incorrect:
red:blue:Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
RoxyFoxy
Highly Voted 2 years, 4 months agoMPignaProTech
Most Recent 3 months agoz24134
1 year, 2 months agoDarGrin
1 year, 3 months agoduydn
1 year, 4 months agoSreeni_A
1 year, 5 months agoVicky_65
1 year, 9 months ago[Removed]
2 years, 1 month agowillokans
2 years, 1 month agoanmoldev2java
2 years, 1 month agoamigo31
2 years, 1 month agomorgan3987
2 years, 2 months agocarloswork
2 years, 2 months agocarloswork
2 years, 2 months agocarloswork
2 years, 2 months agocarloswork
2 years, 2 months agocarloswork
2 years, 2 months agohhuo
2 years, 3 months agocarloswork
2 years, 2 months agoanmoldev2java
2 years, 2 months agowk8b
2 years, 3 months ago