Tested and got 2413
This creates a 2D array:
n[0] = {1, 3}
n[1] = {2, 4}
First for Loop (Reverse Iteration of n):
for (int i = n.length - 1; i >= 0; i--)
n.length is 2 (since it has two rows).
i starts at 1 (i.e., n.length - 1).
The loop runs from i = 1 down to i = 0.
Nested Enhanced for Loop (Iterating Over Each Row):
for (int y : n[i])
This iterates over each element in n[i].
Execution Order:
First Iteration (i = 1 → n[1] = {2, 4}):
for (int y : n[1]) prints:
2 4
Second Iteration (i = 0 → n[0] = {1, 3}):
for (int y : n[0]) prints:
1 3
public static void main(String[] args) {
int[][] n = {{1, 3}, {2, 4}};
for (int i = n.length - 1; i >= 0; i--) {
for (int y : n[i]) {
System.out.print(y);
}
}
}
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
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.
DJava
Highly Voted 4 years, 10 months agoabhayshitole
1 month, 2 weeks agorasifer
Highly Voted 4 years, 9 months agoTheeOne
Most Recent 1 month, 4 weeks agoAhmadTechie
4 months, 3 weeks agoAhmadTechie
4 months, 3 weeks agomesonjesi
5 months, 1 week agoDarGrin
6 months, 1 week agoa_really_reliable_programmer
7 months, 2 weeks agoOmar_Deeb
8 months agoSreeni_A
8 months agodsms
8 months, 1 week agowinfred_lu
9 months, 2 weeks agotuyetan
10 months, 1 week agoKolodets
11 months, 4 weeks agoCreazyyyyGirl
1 year, 1 month agoRajeevkuamr
1 year, 3 months agoakbiyik
1 year, 4 months ago