sentence structure

sentence structure

ID:37399626

大小:166.50 KB

页数:49页

时间:2019-05-23

sentence structure_第1页
sentence structure_第2页
sentence structure_第3页
sentence structure_第4页
sentence structure_第5页
资源描述:

《sentence structure》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、1.Given:1.publicclasstest(2.publicstaticvoidmain(Stringargs[]){3.inti=0xFFFFFFF1;4.intj=~i;5.6.}7.)Whatisthedecimalvalueofjatline5?A.0B.1C.14D.-15E.Anerroratline3causescompilationtofail.F.Anerroratline4causescompilationtofail.C2.Given:Integeri=newInteger(42);Long1=newLong(42);D

2、oubled=newDouble(42.0);WhichtwoexpressionsevaluatetoTrue?(ChooseTwo)A.(i==1)B.(i==d)C.(d==1)D.(i.equals(d))E.(d.equals(i))F.(i.equals(42))3.Clicktheexhibitbutton:1.publicclasstest(2.privatestaticintj=0;3.4.privatestaticbooleanmethodB(intk)(5.j+=k;6.returntrue;7.)8.9.publicstati

3、cvoidmethodA(inti){10.booleanb;11.b=i<10

4、methodB(4);12.b=i<10

5、

6、methodB(8);13.)14.15.publicstaticvoidmain(Stringargs[]}(16.methodA(0);17.system.out.printIn(j);18.)19.)Whatistheresult?A.Theprogramprints“0”B.Theprogramprints“4”C.Theprogramprints“8”D.Theprogramprints“12”E.Thecodedo

7、esnotcompleteB4.Given:1.Publicclasstest(2.Publicstaticvoidmain(Stringargs[])(3.System.out.printIn(6^3);4.)5.)Whatistheoutput?Ans:55.Given:1.publicclassFoo{2.publicstaticvoidmain(String[]args){3.StringBuffera=newStringBuffer(“A”);4.StringBufferb=newStringBuffer(“B”);5.operate(a,

8、b);6.system.out.printIn{a+“,”+b};7.)8.staticvoidoperate(StringBufferx,StringBuffery){9.x.append{y};10.y=x;11.)12.}Whatistheresult?A.Thecodecompilesandprints“A,B”.B.Thecodecompilesandprints“A,A”.C.Thecodecompilesandprints“B,B”.D.Thecodecompilesandprints“AB,B”.E.Thecodecompilesan

9、dprints“AB,AB”.F.Thecodedoesnotcompilebecause“+”cannotbeoverloadedforStringBuffer.D6.Clicktheexhibitbutton:1.Publicclasstest(2.PublicstaticvoidstringReplace(Stringtext)(3.Text=text.replace(‘j’,‘i’);4.)5.6.publicstaticvoidbufferReplace(StringBuffertext)(7.text=text.append(“C”)8.

10、)9.10.publicstaticvoidmain(Stringargs[]}(11.StringtextString=newString(“java”);12.StringBuffertextBufferString=newStringBuffer(“java”);13.14.stringReplace(textString);15.BufferReplace(textBuffer);16.17.System.out.printIn(textString+textBuffer);18.}19.)Whatistheoutput?Ans:javaja

11、vac7.ClicktheExhibitbutton:1.publicclasstest{2.publics

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

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

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