java期末试卷全英_英文的JAVA试题5 高手 牛人进~~垃圾闪``谢谢

英文的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();}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值