The right answer is B, in the for each the var "arr" has a value of 2, therefore the for inside it will receive the same value, that is, it will only get the 2 values of each line, printing 1 3 1 3.
OBS: Always remember that Java indexes from 0.
upvoted 2 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.
dsms
5 months, 3 weeks agocarloswork
1 year, 2 months agoiSnover
1 year, 3 months ago