英文的JAVA试题5 高手 牛人进~~垃圾闪``谢谢0
22 Which of the statements regarding the super keyword is incorrect?
A. You can use super to invoke a super class constructor.
B. You can use super to invoke a super class method.
C. You can use super.super.p to invoke a method in superclass?s parent class.
D. You cannot invoke a method in superclass?s parent class.
23 Which of the following statements are true?
A. A method can be overloaded in the same class.
B. A method can be overridden in the same class.
C. If a method overloads another method, these two methods must have the same signature.
D. If a method overrides another method, these two methods must have the same signature.
24 Given the following code, find the syntax error?
public class Test {
public static void main(String[] args) {
m(new GraduateStudent());
m(new Student());
m(new Person());
m(new Object());
}
public static void m(Student x) {
System.out.println(x.toString());
}
}
class GraduateStudent extends Student {
}
class Student extends Person {
public String toString() {
return "Student";
}
}
class Person extends Object {
public String toString() {
return "Person";
}
}
A. m(new GraduateStudent()) causes an error
B. m(new Student()) causes an error
C. m(new Person()) causes an error
D. m(new Object()) causes an error
25 Given the following code:
class C1 {}
class C2 extends C1 { }
class C3 extends C2 { }
class C4 extends C1 {}
C1 c1 = new C1();
C2 c2 = new C2();
C3 c3 = new C3();
C4 c4 = new C4();
Which of the following expressions evaluates to false?
A. c1 instanceof C1
B. c2 instanceof C1
C. c3 instanceof C1
D. c4 instanceof C2
36 Which of the following statements is false?
A. A public class can be accessed by a class from a different package.
B. A private method cannot be accessed by a class in a different package.
C. A protected method can be accessed by a subclass in a different package.
D. A method with no visibility modifier can be accessed by a class in a different package.
37 Which of the following is a correct interface?
A. interface A { void print() { }; }
B. abstract interface A { print(); }
C. abstract interface A { abstract void print() { };}
D. interface A { void print();}