阿摩線上測驗 登入

試題詳解

試卷:104年 - SCJP 1-50#41416 | 科目:OJCP(SCJP)

試卷資訊

試卷名稱:104年 - SCJP 1-50#41416

年份:104年

科目:OJCP(SCJP)

第14題 Given: 11. class Person{ 12. String name = "No name"; 13. public Person(String nm){name = nm;} 14. } 15. 16. class Employee extends Person{ 17. String empID = "0000"; 18. public Employee(String id){empID = id;} 19. } 20. 21. class EmployeeTest{ 22. public static void main(String[] args){ 23. Employee e = new Employee("4321"); 24. System.out.println(e.empID); 25. } 26. } What is the result?
(A) 4321
(B) 0000
(C) An exception is thrown at runtime.
(D) Compilation fails because of an error in line 18.
正確答案:登入後查看

詳解 (共 1 筆)

推薦的詳解#2782943
未解鎖
 18 行就是 public Emplo...
(共 596 字,隱藏中)
前往觀看
10
0