欢迎来到天天文库
浏览记录
ID:62159351
大小:22.14 KB
页数:11页
时间:2021-04-19
《南宁java培训java基础(易唐).docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、JAVASE部分1、Choosethethreevalididentifiersfromthoselistedbelow.(Choosethree)?A.IDoLikeTheLongNameClassB.$byteC.constD._okE.3_case2、Whichofthefollowinglinesofcodewillcompilewithouterror(Choosetwo)?A.inti=0;if(i){System.out.println(“Hi”);}B.booleanb=true;booleanb2=true;if
2、(b==b2){System.out.println(“Sotrue”);}C.inti=1;intj=2;if(i==1
3、
4、j==2)System.out.println(“OK”);D.inti=1;intj=2;if(i==1&
5、j==2)System.out.println(“OK”);3、Whichtwodemonstratea"hasa"relationship(Choosetwo)?A.publicinterfacePerson{}publicclassEmployeeextendsPerson{}B.publici
6、nterfaceShape{}publicinterfaceRectandleextendsShape{}C.publicinterfaceColorable{}publicclassShapeimplementsColorable{}D.publicclassSpecies{}publicclassAnimal{privateSpeciesspecies;}E.interfaceComponent{}classContainerimplementsComponent{privateComponent[]children;}4、W
7、hatwillhappenwhenyouattempttocompileandrunthefollowingcode?publicclassStatic{static{intx=5;}staticintx,y;publicstaticvoidmain(Stringargs[]){x--;myMethod();System.out.println(x+y+++x);}publicstaticvoidmyMethod(){y=x+++++x;}}A.compiletimeerrorB.prints:1C.prints:2D.print
8、s:3E.prints:7F.prints:85、Whatisthecorrectorderingfortheimport,classandpackagedeclarationswhenfoundinasinglefile?A.package,import,classB.class,import,packageC.import,package,classD.package,class,import6、Whatwillhappenwhenyouattempttocompileandrunthefollowingcode.public
9、classPvf{staticbooleanPaddy;publicstaticvoidmain(Stringargv[]){System.out.println(Paddy);}}A.CompiletimeerrorB.compilationandoutputoffalseC.compilationandoutputoftrueD.compilationandoutputofnull7、Giventhefolowingclasseswhichofthefollowingwillcompilewithouterror?interf
10、aceIFace{}classCFaceimplementsIFace{}classBase{}publicclassObRefextendsBase{publicstaticvoidmain(Stringargv[]){ObRefob=newObRef();Baseb=newBase();Objecto1=newObject();IFaceo2=newCFace();}}A.o1=o2;B.b=ob;C.ob=b;D.o1=b;8、下面那几个函数是publicvoidmethod(){...}的重载函数?A)publicvoid
11、method(intm){...}B)publicintmethod(){...}C)publicvoidmethod2(){...}D)publicintmethod(intm,floatf){...}9、给出如下声明:Strings=“Exam
此文档下载收益归作者所有