文档介绍:1)
下列Java Swing组件,()是容器组件。()选择二项
a)
JFrame
b)
JButton
c)
JTextArea
d)
JPanel
参考答案
a,d
2)
下列Java语句中,()可以创建一个3行4列的JTextArea组件。(选择一项)
a)
JTextArea j=new JTextArea(4,3);
b)
JTextArea j=new JTextArea(3,4);
c)
JTextArea j=new JTextArea(3,4,“TextArea”);
d)
JTextArea j=new JTextArea(4,3 ,“TextArea”);
参考答案
b
3)
给定某java程序的main方法如下,该程序的运行结果是()。(选择一项)
public static void main(String[]args) {
boolean boo=true;
if(boo= =false){
(“a”);
}
Else
{
(“b”);
}
}
a)
a
b)
b
c)
c
d)
d
参考答案
b
4)
在JAVA中,无论测试条件是什么,下列()循环将至少执行一次。(选择一项)
a)
for
b)
do…while
c)
while
d)
while…do
参考答案
b
5)
在JAVA中,()类提供定位本地文件系统,对文件或目录及属性进行基本操作。(选择一项)
a)
FileInputStream
b)
FileReader
c)
FileWriter
d)
File
参考答案
d
6)
在JAVA中,()关键字用来终止循环语句。(选择一项)
a)
return
b)
continue
c)
break
d)
exit
参考答案
c
7)
以下JAVA语句中,()可以构造一个BufferedInputStream对象。(选择一项)
a)
new BufferedInputStream(new FileOutputStream(“”));
b)
new BufferedInputStream(new IutputStream(“”));
c)
new BufferedInputStream(new FileReader(“”));
d)
new BufferedInputStream(new FileIutputStream(“”));
参考答案
d
8)
在JAVA中,.db下定义了一个类,.util下的所有类都可以访问这个类,这个类必须定义为()。(选择一项)
a)
protected
b)
private
c)
public
d)
friendly
参考答案
c
9)
给定java代码,如下,编译运行后,结果是()。(选择一项)
public class Test{
static String s;
public static void main(String args[]){
char c=(0);
(c);
}
}
a)
编译错误
b)
运行期异常,异常类型为NullPointerException
c)
运行期异常,异常类型为ArithmeticException
d)
正确运行,但无输出内容
参考答案
b
10)
给定Java代码如下,关于super的用法,以下描述正确的是()。(选择一项)
class C extends B{
public C(){
super();
}
}
a)
用来调用类B中定义的super()方法
b)
用来调用类C中定义的super()方法
c)
用来调用类B的无参构造方法
d)
用来调用类B中第一个出现的构造方法
参考答案
c
11)
,编译运行,结果是()。(选择一项)
;
class Test{
protected void talk(){
(“talk”);
}
}
给定Test的子类Test2,代码如下:
.util;
.*;
public class Test2 extends Test{
public static void main(String[] arg