nerdexam
Oracle

1Z0-851 · Question #102

1Z0-851 Question #102: Real Exam Question with Answer & Explanation

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

Question

Given: 23. Object [] myObjects = { 24. new Integer(12), 25. new String("foo"), 26. new Integer(5), 27. new Boolean(true) 28. }; 29. Arrays.sort(myObjects); 30. for(int i=0; i<myObjects.length; i++) { 31. System.out.print(myObjects[i].toString()); 32. System.out.print(" "); 33. } What is the result?

Options

  • ACompilation fails due to an error in line 23.
  • BCompilation fails due to an error in line 29.
  • CA ClassCastException occurs in line 29.
  • DA ClassCastException occurs in line 31.
  • EThe value of all four objects prints in natural order.

Unlock 1Z0-851 to see the answer

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