nerdexam
Oracle

1Z0-808 · Question #33

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

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

Creating and Using Arrays

Question

int nums1[] = new int [3]; int nums2[] = {1, 2, 3, 4, 5}; nums1 = nums2; for (int x : nums1){ System.out.print (x + ":"); } What is the result?

Options

  • A1:2:3:4:5:
  • B1:2:3:
  • CCompilation fails.
  • DAn ArrayIndexOutOfBoundsException is thrown at runtime.

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

#array reference assignment#reference semantics#enhanced for loop#array initialization
Full 1Z0-808 Practice