Java笔试试题集合

Java笔试试题集合

ID:40156951

大小:601.46 KB

页数:90页

时间:2019-07-23

Java笔试试题集合_第1页
Java笔试试题集合_第2页
Java笔试试题集合_第3页
Java笔试试题集合_第4页
Java笔试试题集合_第5页
资源描述:

《Java笔试试题集合》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、1JAVASE部分1、Choosethethreevalididentifiersfromthoselistedbelow.(Choosethree)?A.IDoLikeTheLongNameClassB.$byteC.constD._okE.3_case答:ABD2、Whichofthefollowinglinesofcodewillcompilewithouterror(Choosetwo)?A.inti=0;if(i){System.out.println(“Hi”);}B.booleanb

2、=true;booleanb2=true;if(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”);答:BC3、Whichtwodemonstratea"hasa"relationship(Choosetwo)?A.publicinterfacePerson{

6、}publicclassEmployeeextendsPerson{}B.publicinterfaceShape{}publicinterfaceRectandleextendsShape{}C.publicinterfaceColorable{}publicclassShapeimplementsColorable{}D.publicclassSpecies{}CopyrightTarenaCorporation,2009.Allrightsreserved2publicclassAnimal

7、{privateSpeciesspecies;}E.interfaceComponent{}classContainerimplementsComponent{privateComponent[]children;}答:DE4、Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?publicclassStatic{static{intx=5;}staticintx,y;publicstaticvoidmain(Stringargs

8、[]){x--;myMethod();System.out.println(x+y+++x);}publicstaticvoidmyMethod(){y=x+++++x;}}A.compiletimeerrorB.prints:1C.prints:2D.prints:3E.prints:7F.prints:8答:D5、Whatisthecorrectorderingfortheimport,classandpackagedeclarationswhenfoundinasinglefile?A.pa

9、ckage,import,classB.class,import,packageC.import,package,classD.package,class,import答:A6、Whatwillhappenwhenyouattempttocompileandrunthefollowingcode.publicclassPvf{staticbooleanPaddy;publicstaticvoidmain(Stringargv[]){System.out.println(Paddy);}}Copyr

10、ightTarenaCorporation,2009.Allrightsreserved3A.CompiletimeerrorB.compilationandoutputoffalseC.compilationandoutputoftrueD.compilationandoutputofnull答:B7、Giventhefolowingclasseswhichofthefollowingwillcompilewithouterror?interfaceIFace{}classCFaceimplem

11、entsIFace{}classBase{}publicclassObRefextendsBase{publicstaticvoidmain(Stringargv[]){ObRefob=newObRef();Baseb=newBase();Objecto1=newObject();IFaceo2=newCFace();}}A.o1=o2;B.b=ob;C.ob=b;D.o1=b;答:ABD8、下面那几个函数是publicvoidmethod(){...}的重载函数?A)public

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。