




如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
SCJP模拟试题二 -------------------------------------------------------------------------------- 此套试题由60道题组成(实际考试为60道题)。 -------------------------------------------------------------------------------- Questions Question1) Whichofthefollowinglineswillcompilewithoutwarningorerror. a)floatf=1.3; b)charc="a"; c)byteb=257; d)booleanb=null; e)inti=10; answer -------------------------------------------------------------------------------- Question2) Whatwillhappenifyoutrytocompileandrunthefollowingcode publicclassMyClass{ publicstaticvoidmain(Stringarguments[]) { amethod(arguments); } publicvoidamethod(String[]arguments) { System.out.println(arguments); System.out.println(arguments[1]); } } 1)errorCan'tmakestaticreferencetovoidamethod. 2)errormethodmainnotcorrect 3)errorarraymustincludeparameter 4)amethodmustbedeclaredwithString answer -------------------------------------------------------------------------------- Question3) Whichofthefollowingwillcompilewithouterror 1)importjava.awt.*; packageMypackage; classMyclass{} 2)packageMyPackage; importjava.awt.*; classMyClass{} 3)/*Thisisacomment*/ packageMyPackage; importjava.awt.*; classMyClass{} answer -------------------------------------------------------------------------------- Question4) Abytecanbeofwhatsize 1)-128to127 2)(-2power8)-1to2power8 3)-255to256 4)dependsontheJavaVirtualmachine answer -------------------------------------------------------------------------------- Question5) Whatwillbeprintedoutifthiscodeisrunwiththefollowingcommandline javamyproggoodmorning publicclassmyprog{ publicstaticvoidmain(Stringargv[]) { System.out.println(argv[2]) } } 1)myprog 2)good 3)morning 4)Exceptionraised:"java.lang.ArrayIndexOutOfBoundsException:2" answer -------------------------------------------------------------------------------- Question6) Whichofthefollowingarejavareservedwords 1)if 2)then 3)goto 4)while 5)case answer -----------------------------------------------------------

ys****39
实名认证
内容提供者


最近下载