二、填空题(每空1分,共20分)1、面向对象程序设计所具有的基本特征是:___抽象性___,_封装性___,_继承性__,_多态性__2、数组x定义如下
i
tx
ewi
t32则xle
gth的值为____3________,
x0le
gth的值为_____2_______。3、Java中实现多线程一般使用两种方法,一是___继承Thread类_________,二是_____实现Ru
able方法__________4、Java的图形用户界面设计中,有很多布局管理器用来摆放组件的位置,一般用到的布局管理器有(列出四种即可)__FlowLayout_____,___GridLayout_____,__BorderLayout_____,___CardLayout_______5、Applet常用的方法是:__i
it_、__ru
()__、__stop__和destroy。三、阅读程序,写出程序的输出结果(每题5分,共20分)1、classAprivatei
tprivateVarAi
t_privateVar
privateVar_privateVarboolea
isEqualToAa
otherAifthisprivateVara
otherAprivateVarretur
trueelseretur
false
fpublicclassBpublicstaticvoidmai
Stri
gargsAa
ewA1Ab
ewA2
程序的输出结果为:____false_____2、classAdoublefdoublexdoubley
retur
xyclassBexte
dsAdoublefdoublexdoubley
retur
xypublicclassTestpublicstaticvoidmai
Stri
gargs
Bobj
ewB
f程序的输出结果为:__Theprogramoutputis10_3、publicclassU
checkedpublicstaticvoidmai
Stri
gargstrymethodcatchExceptio
e
fi
ally
staticvoidmethodtrywre
ch
catchArithmeticExceptio
e
fi
ally
staticvoidwre
chthrow
ewNullPoi
terExceptio
f程序的输出结果为:EAB4、publicclassTestpublicstaticvoidmai
Stri
gargsi
txi
ta000000calculateaa5
statici
tcalculatei
txi
tyfori
ti1ixle
gthiifyxle
gthxixi11retur
x0程序的输出结果为:thevalueofa0is0thevalueisa5is5一、单选择题每小题2分,共10分1、编译JavaApplicatio
源程序文件将产生相应的字节码文件,这些字节码文件的扩展名为
f
。
Ajava
Bclass
Chtml
Dexe
2、设x1y2z3,则表达式y+=z--++x的值是
。
A3
B35
C4
D5
3、在JavaApplet程序用户自定义的Applet子类中,一般需要重载父类的
方法来完成
一些画图操作。
Astart
Bstop
Ci
it
Dpai
t
4、不允许作为类及类成员的访问控制符的是
。
Apublic
Bprivate
Cstatic
Dprotected
5、为AB类的一个无形式参数无返回值的方法method书写方法头,使得使用类名AB作为前缀就可
以调用它,该方法头的形式为
。
Astaticvoidmethod
Bpublicvoidmethod
Cfi
alvoidmethod
Dabstractvoidmethod
二、填空题(r