《JAVA 程序设计》期末考试试题(三)
一、单项选择题
1、如下哪个是 Java 中的标识符()
A、public B、super C、3number D、width
2、如下哪个是 Java 中的标识符( )
A、fieldname B、super C、3number D、#number
3、已知如下定义:String s = "story"; 下面哪个语句不是合法的( )
A、s += "books"; B、s = s + 100;
C、int len = ; D、String t = s + “abc”;
4、如下哪个是 Java 中有效的关键字()
A、name B、hello C、false D、good
5、下面的代码段执行之后 count 的值是什么( )
int count = 1;
for (int i = 1; i <= 5; i++) {
count += i;
}
(count);
A、5 B、1 C、15 D、16
6、定义一个类,必须使用的关键字是( )
A、public B、class C、interface D、static
7、定义一个接口必须使用的关键字是( )
A、public B、class C、interface D、static
8、如果容器组件 p 的布局是 BorderLayout,则在 p 的下边中添加一个按钮 b,
应该使用的语句是( )
A、(b); B、(b,"North");
C、(b,"South"); D、(p,"North");
9、声明并创建一个按钮对象 b,应该使用的语句是( )
A、Button b=new Button(); B、button b=new button();
C、Button b=new b(); D、(“确定”);
10、Frame 对象默认的布局管理器是( )
A、FlowLayout B、BorderLayout
C、CardLayout D、null
11、下列哪一个 import 命令可以使我们在程序中创建输入/输出流对象()
A、import .*; B、import .*;
C、import .*; D、import .*;
12、下面哪一个 import 命令可以为我们提供编写网络应用程序的类()
A、import .*; B、import .*;
C、import .*; D、import .*;
13、如果需要从文件中读取数据,则可以在程序中创建哪一个类的对象()
A、FileInputStream B、FileOutputStream
C、DataOutputStream D、FileWriter
二、填空题
1、如果将类 MyClass 声明为 pub
《java程序设计》期末考试试题_(三) 来自淘豆网m.daumloan.com转载请标明出处.