二、填空题(每空2分,共计30分)
1.某二叉树中度为2的结点有18个,则该二叉树中有____个叶子结点。
2.在面向对象方法中,类的实例称为____。
3.诊断和改正程序中错误的工作通常称为____。
4.在关系数据库中,把数据表示成二维表,每一个二维表称为____。
5.问题处理方案的正确而完整的描述称为____。
6.面向对象的语言将客观世界都看成由各种对象组成,共同特征和行为的对象组成类,
类是变量和____的集合体。
7.Java 源文件中最多只能有一个____类,其他类的个数不限。
8.在 Java 中所有实现的多维数组,实际上是由一维数组构成的____。
9.每个Applet程序必须有一个类是____类的子类。
10.线程在生命周期中要经历 5 种状态,分别是新建状态、可运行状态、运行状态、____状
态和终止状态。
11.FileInputStream 是字节流;BufferedWriter 是字符流;ObjectOutputStream 是____。
12.break 语句最常见的用法是 switch 语句中,通过 break 语句退出 switch 语句,
使程序从整个 switch 语句后面的____开始执行。
13.请阅读下列程序代码,然后将程序的执行结果补充完整。
程序代码:
public class throwsException{
static void Proc(int sel)
throw ArithmeticException,ArrayIndexOutOfBoundsException{
System.out.println("In Situation"+sel);
if(sel==0){
System.out.println("no Exception caught");
return;
}else if(sel==1){
int iArray[]=new int[4];
iArray[1]=3;
}
}
public static void main(String args[]){
try {
Proc(0);
Proc(1);
}catch (ArrayIndexOutOfBoundsException e){
System.out.println("Catch"+e);
}finally{
System.out.println("in Proc finally");}
}
}
执行结果:
In Situation0
no Exception caught
____
in Proc finally