Java认证模考试题(六)
文章作者 100test 发表时间 2007:03:14 17:02:52
来源 100Test.Com百考试题网
Question: 35
In the Test.java source file, which are correct class definitions?
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 T1, T2 {
public int x = 0.
public Test (int x) {
this.x = x.
}
}
D. public class Test extends T1{
public int x=0.
public Test(int x){
this.x = x.
}
}
E. protected class Test extends T2{
public int x=0.
public Test(int x){
this.x=x.
}
}
Explanation:
In the Test.java source file the class name should be Test, not test, for it is case-sensitive in Java. One class should have not more than one superclass. The protected modifier can not be put in front of the class.
Correct Answer: B,D 35 of 60