nerdexam
Oracle

1Z0-808 · Question #5

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

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

Creating and Using Arrays

Question

Given the code fragment:
  1. public class Test {
  2. public static void main(String[] args) {
  3. /* insert code here */
  4. array[0]=10;
  5. array[1]=20;
  6. System.out.print (array[0]+":"+array[1]);
  7. }
  8. } Which code fragment, when inserted at line 3, enables the code to print 10:20?

Options

  • Aint[] array = new int[2];
  • Bint[] array; array = int[2];
  • Cint array = new int[2];
  • Dint array [2];

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 declaration#array initialization#new keyword#syntax
Full 1Z0-808 Practice