在线名词解释大全
专业、全面、易懂的全领域名词百科

在如下源代码中(其中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; } 

} 

正确答案: