Oracle
1Z0-809 · Question #178
1Z0-809 Question #178: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #178. The question stem and answer options stay visible for context.
Question
Given the following array:
int[] intArr = {8, 16, 32, 64, 128};
Which two code fragments, independently, print each element in this array?
A) for (int i : intArr) {
System.out.print(i + " ");
}
B) for (int i : intArr) {
System.out.print(intArr[i] + " ");
}
C) for (int i=0; i<intArr.length; i++) {
System.out.print(i + " ");
}
D) for (int i=0; i<intArr.length; i++) {
System.out.print(intArr[i] + " ");
i++;
}
E) for (int i=0; i<intArr.length; i++) {
System.out.print(intArr[i] + " ");
}
F) for (int i, j = intArr.length; i++<j; ) {
System.out.print(intArr[i] + " ");
}
Options
- AOption A
- BOption B
- COption C
- DOption D
- EOption E
- FOption F
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.