A-A+

在下列源代码文件Test.java中 哪个选项是正确的类定义? ()A.public cla

2022-08-06 04:54:24 问答库 阅读 176 次

问题详情

在下列源代码文件Test.java中,哪个选项是正确的类定义? ()
A.public 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 Ti,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

考点:选项,定义