预览加载中,请您耐心等待几秒...
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9
在线预览结束,喜欢就下载吧,查找使用更方便
如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
第PAGE\*Arabic\*MERGEFORMAT9页共NUMPAGES\*Arabic\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页第PAGE\*MERGEFORMAT9页共NUMPAGES\*MERGEFORMAT9页2022Sunjava认证考试真题答案Sunjava认证考试真题答案SUN认证是给网络设计界建立的一套认证标准,Sun公司推出了Java以及Solaris技术认证方案。以下是我整理的关于Sunjava认证考试真题答案,希望大家仔细阅读!1.Whatgetsprintedwhenthefollowingprogramiscompiledandrun?classTest{publicstaticvoidmain(Stringargs[]){inti;do{i++;}while(i<0);System.out.println(i);}}Select1correctanswer:A.Theprogramdoesnotcompileasiisnotinitialized.B.Theprogramcompilesbutdoesnotrun.C.Theprogramcompilesandrunsbutdoesnotprintanything.D.Theprogramprints0.E.Theprogramprints1.答案:A:假如没有初始化便运用基本变量类型,会导致编译时异样,程序不能编译。2.Whatgetsprintedwhenthefollowingprogramiscompiledandrun?publicclassXYZ{publicstaticvoidmain(Stringargs[]){inti,j,k;for(i=0;i<3;i++){for(j=1;j<4;j++){for(k=2;k<5;k++){if((i==j)&&(j==k))System.out.println(i);}}}}}Select1correctanswer:A.0B.1C.2D.3E.4答案:C3.Giventhefollowingcode:classBase{}publicclassMyCastextendsBase{staticbooleanb1=false;staticinti=-1;staticdoubled=10.1;publicstaticvoidmain(Stringargv[]){MyCastm=newMyCast();Baseb=newBase();//Here}}Whichofthefollowing,ifedatthecomment//Herewillallowthecodetocompileandrunwithouterror?Select2correctanswers:A.b=m;B.m=b;C.d=i;D.b1=i;解析:A从子类型到父类型的转换是扩展引用转换,不须要在运行时实行特别的动作,不会在运行时抛出异样。B从超类型到子类型的转换是收缩引用转换,须要在运行时执行测试,以查明实际的引用值是否是新类型的合法值.假如不是,则会抛出ClassCascException。在这里,b本身不是MyCast类型的值,因此会导致运行时异样。C从int到double的转换是扩展基本转换,基本类型之间的扩展转换恒久不会导致运行时异样。但从int或long到float,或者是从long到double都可能导致精度丢失。D不允许进行int和boolean之间的.类型转换答案:A、C4.Giventhefollowingclasseswhichofthefollow