nerdexam
Oracle

1Z0-808 · Question #20

1Z0-808 Question #20: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-808 to reveal the answer and full explanation for question #20. The question stem and answer options stay visible for context.

Using Loop Constructs

Question

Given the following array: int[] intArr = {8, 16, 32, 64, 128}; Which two code fragments, independently, print each element in this array?

Options

  • Afor (int i : intArr) { System.out.print (intArr[i] + " "); }
  • Bfor (int i : intArr) { System.out.print (i + " "); }
  • Cfor (int i=0 : intArr) { System.out.print (intArr[i] + " "); i++; }
  • Dfor (int i=0; i < intArr.length; i++) { System.out.print (i + " "); }
  • Efor (int i=0; i < intArr.length; i++) { System.out.print (intArr[i] + " "); }
  • Ffor (int i; i < intArr.length; i++) { System.out.print (intArr[i] + " "); }

Unlock 1Z0-808 to see the answer

You've previewed enough free 1Z0-808 questions. Unlock 1Z0-808 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.

Topics

#enhanced for loop#traditional for loop#array iteration#loop semantics
Full 1Z0-808 Practice