QUESTION 29자격증/OCJP_ExamB2018. 7. 10. 17:24
Table of Contents
반응형
QUESTION 29
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?
A. Mr. John Doe
B. An exception is thrown at runtime.
C. Compilation fails because of an error in line 12.
D. Compilation fails because of an error in line 15.
E. Compilation fails because of an error in line 20.
Solution : A
반응형
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 31 (0) | 2018.07.10 |
---|---|
QUESTION 30 (0) | 2018.07.10 |
QUESTION 28 (0) | 2018.07.10 |
QUESTION 27 (0) | 2018.07.10 |
QUESTION 26 (0) | 2018.07.10 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상