Java试题(一)一、选择1
欲构造ArrayList类的一个实例,此类继承了List接口,下列哪个方法是正确的
AArrayListmyList=newObject();BListmyList=newArrayList();CArrayListmyList=newList();DListmyList=newList();2
paint()方法使用哪种类型的参数
AGraphicsBGraphics2DCStringDColor3
指出正确的表达式Abyte=128;BBoolean=null;Clongl=0xfffL;Ddouble=0
9239d;4
指出下列程序运行的结果publicclassExample{Stringstr=newString("good");char[]ch={'a','b','c'};publicstaticvoidmain(Stringargs[]){Exampleex=newExample();ex
change(ex
str,ex
ch);System
print(ex
str+"and");Sytem
print(ex
ch);}publicvoidchange(Stringstr,charch[]){str="testok";ch[0]='g';}}AgoodandabcBgoodandgbcCtestokandabcDtestokandgbc5
运行下列程序,会产生什么结果publicclassXextendsThreadimplementsRunable{publicvoidrun(){System
println("thisisrun()");}publicstaticvoidmain(Stringargs[]){Threa