当前位置:在线题库搜索>[单选题]在下列源代码文件Test.java中,正确定义类的代码是( )。的答案是什么?

问题:

[单选题]在下列源代码文件Test.java中,正确定义类的代码是( )。

A、pblic class test { public int x=0; public test(int x) { this. x=x;} }
B、public class Test { public int x=0; public Test(int x) { this. x=x;} }
C、public class Test extends T1,T2{ 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; } }

参考答案: B