Oracle
1Z0-851 · Question #89
1Z0-851 Question #89: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #89. The question stem and answer options stay visible for context.
Question
Given: 11. public enum Title { 12. MR("Mr."), MRS("Mrs."), MS("Ms."); 13. private final String title; 14. private Title(String t) { title = t; } 15. public String format(String last, String first) { 16. return title + " " + first + " " + last; 17. } 18. } 19. 20. public static void main(String[] args) { 21. System.out.println(Title.MR.format("Doe", "John")); 22. } What is the result?
Options
- AMr. John Doe
- BAn exception is thrown at runtime.
- CCompilation fails because of an error in line 12.
- DCompilation fails because of an error in line 15.
- ECompilation fails because of an error in line 20.
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.