(单选题)1: 下列语句的输出结果是 。public class A{public static void main(String[]args){System.out.println(2>1);}} A: true B: false C: 1 D: 0 (单选题)2: 构造方法在 时候被调用。 A: 类定义时 B: 创建对象时 C: 调用对象方法时 D: 使用对象的变量时 (单选题)3: 下列Java源文件代码片段中, 是不正确的。 A: package t;public class A{} B: import java.io.*;package t;public class A{} C: import java.io.*;class A{}public class B{} D: import java.io.*;import java.awt.*;public class A{} (单选题)4: 下列代码的执行结果是 。public class A{public static void main(String[]args){System.out.println(5/2);}} A: 2.5 B: 2.0 C: 3 D: 2 (单选题)5: 在Java的基本数据类型中,int型数据占用 字节内存空间。 A: 1 B: 2 C: 4 D: 不能确定,取决于计算机字长 (单选题)6: 在Java中, 语句作为异常处理的统一出口。 A: throw B: try C: finally D: catch (单选题)7: 下列Java常见事件类中 是鼠标事件类。 A: InputEvent B: KeyEvent C: MouseEvent D: WindowEvent (单选题)8: 下列关于接口的叙述中, 是正确的。 A: 接口与抽象类是相同的概念 B: 接口之间不能有继承关系 C: 一个类只能实现一个接口 D: 接口中只含有抽象方法和常量 (单选题)9: 以下 可能包含菜单条。 A: Panel B: Applet C: Dialog D: Frame (单选题)10: 下面 函数是public void example(int k){...}的重载函数。 A: public void example( int m){...} B: public int example(int k){...} C: public void example2(int k){...} D: public int example( int m, float f){...} (单选题)11: 如下 字符串是Java中合法的用户自定义标识符。 A: super B: 3number C: #number D: $number (单选题)12: 下列叙述错误的是 A: Java是一种面向对象的网络编程语言 B: Java Applet程序在网络上传输不受硬软件平台的限制 C: Java提供了类库支持TCP/IP协议 D: Java语言允许使用指针访问内存 (单选题)13: 在Java中,用 关键字定义常量。 A: define B: fixed C: const D: final (单选题)14: 下面是类A的构造函数声明,其中正确的是 A: void A(int x){...} B: A(int x){...} C: a(int x){...} D: void a(int x){...} (单选题)15: 若在某一个类定义中定义有方法:abstract void f();则该类是 A: public类 B: final类 C: 抽象类 D: 不能确定 (单选题)16: 布局管理器使容器中各个构件呈网格布局,平均占据容器空间。 A: CardLayout B: BorderLayout C: FlowLayout D: GridLayout (单选题)17: public class Test{ public static void main(String[] args){ String a=args[1];String b=args[2];String c=args[3]; } } execute command:java Test Red Green Blue what is the value of c? A: c has value of null B: c has value of Blue C: the code does not compile D: the program throw an exception (单选题)18: Give incompleted method: //one {if(unsafe()){//do something…} else if(safe()){//do the other…} } The method unsafe() will throw an IOException, which completes the method of declaration when added at line one? A: public IOException methodName() B: public void methodName() C: public void methodName() throw IOException D: public void methodName() throws IOException (单选题)19: Java语言的许多特点中,下列 特点是C++语言所不具备的。 A: 高性能 B: 跨平台 C: 面向对象 D: 有类库 (单选题)20: Java Application源程序文件的扩展名为 A: .java B: .class C: .html D: .exe (判断题)21: ( )A class can implement as many interfaces as needed. A: 错误 B: 正确 (判断题)22: ( )如果p是父类Parent的对象,而c是子类Child的对象,则语句c = p是正确的。 A: 错误 B: 正确 (判断题)23: ( )字符串分为两大类,一类是字符串常量,使用StringBuffer类的对象表示;另一类是字符串变量,使用String类的对象表示。 A: 错误 B: 正确 (判断题)24: ( )抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。 A: 错误 B: 正确 (判断题)25: ( )A subclass inherits all methods ( including the constructor ) from the superclass. A: 错误 B: 正确 (责任编辑:admin) |