java选择题(java multiple-choice questions)

java选择题(java multiple-choice questions)

ID:11631138

大小:25.39 KB

页数:39页

时间:2018-07-13

java选择题(java multiple-choice questions)_第1页
java选择题(java multiple-choice questions)_第2页
java选择题(java multiple-choice questions)_第3页
java选择题(java multiple-choice questions)_第4页
java选择题(java multiple-choice questions)_第5页
资源描述:

《java选择题(java multiple-choice questions)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、java选择题(Javamultiple-choicequestions)49.givethefollowingcodetoaskwhichstatementisinsertedinthetenthlineoftheprogram,andtheprogramcanrunsuccessfullyLine1.classIntTypeLine2.publicStringgetType(Stringa,intb,charc){Line3.Stringholdit1=newString();Line4.holdit1=a;L

2、ine5.returnholdit1;Line6.}Line7.}Line8.Line9.classOverTypeextendsIntType{Line10.Line11.Stringholdit2=newString();Line12.holdit2=holdit2.concat("Thisis").Concat(a);Line13.returnholdit2;Line14.}Line15.Line16.publicstaticvoidmain(String[]a){Line17.OverTypeot=newO

3、verType();Line18.Stringx=newString("X");Line19.inty=1;Line20.charz='b';Line21.System.out.println(getType(x,y,z));Line22.}Line23.}Pleaseselectallthecorrectanswers:(1)publicTextgetType(Stringa,intb,charc){(2)publicTextgetType(intb,Stringa,charc){(3)publicStringg

4、etType(Stringa,intb,charc){(4)publicStringgetType(intb,Stringa,charc){50.whichstatementsareusedinJavalanguageforinterruptcycleexecution?Pleasechooseacorrectanswer:(1)continuestatement(2)gotostatement(3)exitstatement(4)breakstatement51.excuseme,whereisthewrongc

5、odebelow?PublicclassExample{Publicstaticvoidmain(String[]args){For(i=0;j=0,i<10;++i,j+=i){K+=i*i+j*j;}}}Pleaseselectallthecorrectanswers:(1)morethanonesentenceshouldbemorethanonesentenceblock(2)commashouldbeusedbetweeni=0andj=0(3)twocircularvariablesareused(4)

6、semicolonshouldbeusedbetweenj=0andi<1052.excuseme,whereisthefollowingcodefragmentwrong?For(inti=0;i<10;++i){If(x[i]>100)break;If(x[i]<0)continue;X[i+1]=x[i]+y[i];}Pleasechooseacorrectanswer:(1)itisillegaltoappearbothbreakandcontinuestatementsinthesameforloopst

7、atement(2)thevariableIshouldnotbedeclaredandinitializedintheforexpression(3)automaticincrementoperationisnotallowedintheforexpression(4)nothingwrong53.givethefollowingcode,whatistherunningresultofthisprogram?PublicclassExample{Publicstaticvoidmain(String[]args

8、){Intm=2;Intp=1;Intt=0;For((p<5;p++){If(t++>m){M=p+t;}}System.out.println("tequals"+t);}}Pleasechooseacorrectanswer:(1)tequals2(2)tequals4(3)tequals6(4)tequals754.givethefollowingc

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

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

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