Oracle
1Z0-809 · Question #96
1Z0-809 Question #96: Real Exam Question with Answer & Explanation
The correct answer is A. 6 7 8. See the full explanation below for the reasoning.
Question
Given:
public class MyFor1 {
public static void main(String[] args) {
int[] x = {6, 7, 8};
for (int i : x) {
System.out.print(i + " ");
i++;
}
}
}
What is the result?
Options
- A6 7 8
- B7 8 9
- C0 1 2
- D6 8 10
- ECompilation fails
Community Discussion
No community discussion yet for this question.