nerdexam
Oracle

1Z0-829 · Question #39

1Z0-829 Question #39: Real Exam Question with Answer & Explanation

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

Question

Which two code fragments compile?

Options

  • Aclass I6 { public static void main(String[] args) { var x = new ArrayList<>(); x.add(10); x.add("30"); System.out.println(x); } }
  • Bclass I2 { public void m(int x) { var x = 10; } }
  • Cclass A {} class B extends A {} class I4 { public static void main(String[] args) { var x = new A(); x = new B(); } }
  • Dclass I3 { public static void main(String[] args) { var a = 10; a = "30"; } }
  • Eclass I5 { public void m() { var strVar = null; } }

Unlock 1Z0-829 to see the answer

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

Full 1Z0-829 Practice