多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

11. public static void main(String[] args) {  12. Object obj = new Object() {  13. public int hashCode() {  14. returns 42; 15. }  16. };  17. System.out.println(obj.hashCode());  18. }    What is the result? () 

  • A、 42
  • B、 An exception is thrown at runtime.
  • C、 Compilation fails because of an error on line 12.
  • D、 Compilation fails because of an error on line 16.
  • E、 Compilation fails because of an error on line 17.
正确答案:A
答案解析:
进入题库查看解析

微信扫一扫手机做题