nerdexam
Oracle

1Z0-809 · Question #170

Given: class Test { public static void main(String[] args) { int numbers[] = new int[4]; numbers[0] = 10; numbers[1] = 20; numbers = new int[4]; numbers[2] = 30; numbers[3] = 40; for (int x…

The correct answer is A. 0 0 30 40. You've hit your session limit · resets 10:20pm (America/New_York)

Question

Given: class Test { public static void main(String[] args) { int numbers[] = new int[4]; numbers[0] = 10; numbers[1] = 20; numbers = new int[4]; numbers[2] = 30; numbers[3] = 40; for (int x : numbers) { System.out.print("" + x); } } } What is the result?

Options

  • A0 0 30 40
  • BAn exception is thrown at runtime.
  • CCompilation fails.
  • D10 20 30 40

How the community answered

(51 responses)
  • A
    76% (39)
  • B
    12% (6)
  • C
    4% (2)
  • D
    8% (4)

Explanation

You've hit your session limit · resets 10:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice