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

Java认证考试

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

class super (   public int I = 0;   public super (string text) (   I = 1   )   )     public class sub extends super (   public sub (string text) (   i= 2   )   public static void main (straing args) (  sub sub = new sub (“Hello”);   system.out. PrintIn(sub.i);  )   )   What is the result?()

  • A、 Compilation will fail.
  • B、 Compilation will succeed and the program will print “0”
  • C、 Compilation will succeed and the program will print “1”
  • D、 Compilation will succeed and the program will print “2”
正确答案:A
答案解析:
进入题库查看解析

微信扫一扫手机做题