(单选题)1: 下列叙述中不正确的是 A: abstract不能与final并列修饰同一个类 B: abstract类中不可以有private的成员 C: abstract方法必须在abstract类中 D: static方法中能直接处理非static的属性 (单选题)2: 在Java中,子类重新定义一个与从父类那里继承来的域变量(成员变量)完全相同的变量,这称为域的 A: 隐藏 B: 覆盖 C: 重载 D: Java不支持此特性 (单选题)3: 在Java的基本数据类型中,int型数据占用 字节内存空间。 A: 1 B: 2 C: 4 D: 不能确定,取决于计算机字长 (单选题)4: 下列常见的系统定义的异常中, 是数组下标越界异常。 A: ArithmeticException B: IOException C: ArrayIndexOutOfBoundsException D: NullPointerException (单选题)5: 在Java语言中, 包是自动导入的。 A: java.lang B: java.awt C: java.applet D: java.io (单选题)6: 在Java中, 语句作为异常处理的统一出口。 A: throw B: try C: finally D: catch (单选题)7: What happens when you try to compile and run the following program? class Mystery{String s; public static void main(String[] args){ Mystery m=new Mystery();m.go();} void Mystery(){s="constructor";} void go(){System.out.println(s);} } A: this code will not compile B: this code compliles but throws an exception at runtime C: this code runs and "constructor" in the standard output D: this code runs and writes "null" in the standard output (单选题)8: Java语言中, 是所有类的根类。 A: Object B: Root C: Thread D: Applet (单选题)9: Java源文件中最多只能有一个 类,其他类的个数不限。 A: abstract B: public C: final D: interface (单选题)10: 下列 是创建一个标识有“OK”的按钮的语句。 A: TextField b=new TextField("OK"); B: Button b=new Button("OK"); C: TextArea b=new TextArea("OK"); D: Checkbox b=new Checkbox("OK"); (单选题)11: 下列 是不合法的标识符。 A: _book B: 3file C: $good D: a_$2 (单选题)12: 下列关于继承的叙述中, 是正确的。 A: 子类能继承父类的所有方法和状态 B: 子类能继承父类的非私有方法和状态 C: 子类只能继承父类的public方法和状态 D: 子类只能继承父类的方法,而不继承状态 (单选题)13: class A {public int getNumber(int a){return a+1;}} class B extends A {public int getNumber(int a, char c){return a+2;} public static void main(String[] args) {B b=new B();System.out.println(b.getNumber(0));} } what is the result? A: compilation succeeds and 1 is printed B: compilation succeeds and 2 is printed C: compilation succeeds and 3 is printed D: An error at this program cause compilation to fail (单选题)14: 下列保留字中书写正确的是 A: Case B: For C: try D: viod (单选题)15: 创建字符串s:String s=new String("abcd");以下 将改变s。 A: s.append("x"); B: s.concat("y"); C: s.substring(3); D: 以上语句都不会 (单选题)16: 下列代码的执行结果是 。public class A{public static void main(String[]args){System.out.println(5/2);}} A: 2.5 B: 2.0 C: 3 D: 2 (单选题)17: 监听器接口的方法返回值是 A: int B: String C: void D: Object (单选题)18: 一个Java Application运行后,在系统中是作为一个 A: 线程 B: 进程 C: 进程或线程 D: 不可预知 (单选题)19: 有类定义:abstract class A{public abstract void f();}下面关于该类的描述中正确的是 A: 该类可以用new A();实例化一个对象 B: 该类不能被继承 C: 该类的方法不能被重载 D: 以上说法都不对 (单选题)20: 下列命令中, 命令是Java的编译命令。 A: javac B: java C: javadoc D: appletviewer (判断题)21: ( )Java的各种数据类型占用固定长度,与具体的软硬件平台环境无关。 A: 错误 B: 正确 (判断题)22: ( )Java程序里,创建新的类对象用关键字new,回收无用的类对象使用关键字free。 A: 错误 B: 正确 (判断题)23: ( )在Java语言中,系统常量null,false,true既可以大写,也可以小写。 A: 错误 B: 正确 (判断题)24: ( )抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。 A: 错误 B: 正确 (判断题)25: ( )子类要调用父类的方法,必须使用super关键字。 A: 错误 B: 正确 (责任编辑:admin) |