在线名词解释大全 - Java语言程序设计 - 详细

在如下源代码中(其中T1和T2已经定义),哪个是没有语法错误?()

A

 public class Test{ 

     public int x=0; 

     public Test(int x) { this.x = x; } 

}

B

  public class Test extends T1, T2{

       public int x=0;

       public Test (int x){this.x = x; }

}

C

  public Test extends T1{ 

      public int x=0;

      public Test(int x){ this.x = x; }

}

D

 protected class Test extends T2{ 

      public int x=0;

      public Test(int x){ this.x=x; } 

正确答案:
相关推荐
扫描二维码
关注公众平台