black

SCJP程序员认证考试

登录

单项选择题

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. public static void main(String[] args) { 
20. System.out.println(Title.MR.format(”Doe”, “John”)); 
21. } 
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.

相关考题

单项选择题 public class Ball {  public enum Color { RED, GREEN, BLUE };  public void foo() {  // insert code here  { System.out.println(c); }  }  }  Which code inserted at line 14 causes the foo method to print RED, GREEN, and BLUE?()

多项选择题 Whichtwocodefragmentscorrectlycreateandinitializeastaticarrayofintelements?()

多项选择题 35. String #name = “Jane Doe”;  36. int$age=24;  37. Double_height = 123.5;  38. double~temp = 37.5;  Which two are true?()

All Rights Reserved 版权所有©考试题库网(kstiku.com)

备案号:湘ICP备14005140号-3

经营许可证号:湘B2-20140064