搜狐公司JAVA高级工程师笔试题

搜狐公司JAVA高级工程师笔试题

ID:44489647

大小:69.66 KB

页数:7页

时间:2019-10-22

搜狐公司JAVA高级工程师笔试题_第1页
搜狐公司JAVA高级工程师笔试题_第2页
搜狐公司JAVA高级工程师笔试题_第3页
搜狐公司JAVA高级工程师笔试题_第4页
搜狐公司JAVA高级工程师笔试题_第5页
资源描述:

《搜狐公司JAVA高级工程师笔试题》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、1:Aclassdesignrequiresthatamembervariableshouldbeaccessibleonlybysamepackage,whichmodiferwordshouldbeused?A.protectedB.publicC.nomochferD.private2:Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?publicclassStatic{static{intx=5;}staticintx,y;publicstaticvoi

2、dmain(Stringargs[]){X-;myMethod();System.out.println(x+y+++x);}publicstaticvoidmyMethod()y=x+++++x;Choices:A.prints:2B.prints:3C.prints:7D.prints:83:Whatwillbetheresultofexecutingthefollowingcode?publicstaticvoidmain(Stringargs[]){chardigit='a';for(inti=0;i<10;i++){sw

3、itch(digit){case'x':{intj=0;System.out.println(j);}default:{intj=100;System.out.println(j);}}}inti=j;System.out.println(i);}Choices:A.100willbeprinted11times.B.Thecodewillnotcompilebecausethevariableicannotbedeclaredtwicewithinthemain()method・C.Thecodewillnotcompilebe

4、causethevariablejcannotbedeclaredtwicewithintheswitchstatement.A.Noneofthese.4:WhichfragmentsarenotcorrectinJavasourcefile?A.packagetestpackage;publicclassTest{//dosomething...}B.importjava.io.*;packagetestpackage;publicclassTest{//dosomething...}C.importjava.io.*;cla

5、ssPerson{〃dosomething...}publicclassTest{//dosomething...}D.importjava.io.*;importjava.awt.*;publicclassTest{//dosomething・..}/*第一行*/下述程序代码中有语法错误的行是()ointizia[10]zib[10];/*第一行*/for(i=0;i<=9;i++)/*第2行*/ib=ia;厂第4行*/A.第1行B.第2行C.第3行D.第4行6:Whichofthefollowingstatementsaret

6、rue?A.TheautomaticgarbagecollectionoftheJVMpreventsprogramsfromeverrunningoutofmemoryB.AprogramcansuggestthatgarbagecollectionbeperformedandforceitC.GarbagecollectionisplatformindependentD.Anobjectbecomeseligibleforgarbagecollectionwhenallreferencesdenotingitaresetton

7、ull.7:SelectvalididentifierofJava:A.%passwdB.3d_gameC.$chargeD.this8:Math.round(-11.5)等於多少?A.-llB.-12A.-11.5B.none9:Whatresultsfromattemptingtocompileandrunthefollowingcode?publicclassTernarypublicstaticvoidmainfStringargs[]){inta=5;System.out.println(nValueis-"+((a<5

8、)?9.9:9));}}Choices:A.prints:Valueis-9B.CompilationerrorC・prints:Valueis・5D.Noneofthese10:Whichisthemain()methodreturnofaapp

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

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

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