模拟测试题 一 单项选择题 1
下面代码输出什么
public class A { static{ System
print("A"); } A(){ System
print("a"); } } public class B extends A { static{ System
print("B"); } B(){ System
print("b"); } } public class Test { public static void main(String[] args) { new B(); } } a) AaBb b) ABab c) BAba d) BbAa e) Aa f) Bb 2
子类继承父类,正确的是 a) 子类能够继承父类的私有方法和私有状态 b) 子类能够继承父类的 protected 方法,但不能继承父类的 protected 状态 c) 子类能够继承父类的 protected 方法,也能够继承父类的 protected 状态 d) 子类能够继承父类的非私有方法和非私有状态 3
下面代码输出什么
int i = 9; switch(i){ case 1: System
print(""); default: System
print("Error"); case 2: System
print("Good"); case 3: System
print("Best"); } a) 空字符串 b) Error c) ErrorGood d) ErrorGoodBest 4
对jsp 编译的描述正确的是
a) 自动编译 b) 用户输入命令后,自动编译 c) 手动编译 d) 不需要编译 5
对接口的描述正确的是: a) 一个类可以实现多个接口
b) 接口可以有非静态的成员变