请将每一个空的正确答案写在答题卡上。
(2)在面向对象方法中,类的实例称为【__2__】
(6)面向对象的语言将客观世界都看成由各种对象组成,共同特征和行为的对象组成类,类是变量和_【_6__】的集合体。
(7)Java语言源文件最多只能有一个_【7 】_类,其他类的个数不限。
(8)在Java语言中所实现的多维数组,实际上是由一维数组构成的【_8___】
(9)StringBuffer类提供【_9__】字符串对象的表示。
(10)每个Applet程序必须有一个类是【__10__】类的子类。
(11) 线程在生命期中要经历5种状态,分别是新建状态、可运行状态、运行状态、【_11____】状态和终止状态。
(12)FileInputStream 是字节流;BufferedWriter是字符流;ObjectOutputStream是【_12___】。
(14)请阅读下列程序代码,然后将程序的执行结果补充完整。
Public class throwException
{
static void Proc(int sel)
Throws 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 arg[ ]){
try
{
Proc (0);
Proc (1);
}
catch (ArrayIndexOutOfBoundsException e)
{
System.out.println("Catch"+e);
}
finally
{
System.out.println("in Proc finally");
}
}
执行结果:
In .Situation()
No Exception caught
【__14___】
in proc finally
(15)当使用Thread t=new Thread (r) 创建一个线程时,表达式r instanceof Thread的值为_【__15_】.
填空题答案
【2】对象【6】方法【7】public【8】数组的数组【9】可变或可编辑【10】Applet【11】阻塞【12】对象流或对象输出流【14】In Situation 1
【15】false