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

Java认证考试

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

Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?()   class A {}   class B extends A {}   class C extends A {}   public class Q3ae4 {   public static void main(String args[]) {   A x = new A();   B y = new B();   C z = new C();   // insert statement here   }   } 

  • A、x = y;
  • B、z = x;
  • C、y = (B) x;
  • D、z = (C) y;
  • E、y = (A) y;
正确答案:C
答案解析:
进入题库查看解析

微信扫一扫手机做题