欢迎来到天天文库
浏览记录
ID:52672838
大小:45.50 KB
页数:6页
时间:2020-03-29
《中兴面试测试题.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、面试测试题2(一)、选择题(4′×10):(1)Whichofthefollowingrangeofshortiscorrect?CA.-27~27-1B.0~216-1C.-215~215-1D.-231~231-1(2)Whichdeclarationsofidentifiersarelegal?ABEA.$personsB.TwoUsersC.*pointD.thisE._endline(3)Giventhefollowingcode:C1:publicvoidmodify(){2:inti,j,k;3:i=100;4:while(i>0){5:j=i*2;6:Syste
2、m.out.println("Thevalueofjis"+j);7:k=k+1;8:i--;9:}10:}Whichlinemightcauseanerrorduringcompilation?CA.line4B.line6C.line7D.line8(4)Whichofthefollowingansweriscorrecttoexpressthevalue8inoctalnumber?AA.010B.0x10C.08D.0x8(5)WhicharenotJavakeywords?ABA.TRUEB.sizeofC.constD.superE.void(6)Giventhef
3、ollowingcode:1:classPerson{2:publicvoidprintValue(inti,intj){//...}3:publicvoidprintValue(inti){//...}4:}5:publicclassTeacherextendsPerson{6:publicvoidprintValue(){//...}7:publicvoidprintValue(inti){//...}8:publicstaticvoidmain(Stringargs[]){9:Persont=newTeacher();10:t.printValue(10);11:}12:
4、}Whichmethodwillthestatementonline10call?DA.online2B.online3C.online6D.online7(7)Giventhefollowingcode:publicvoidtest(){try{oneMethod();System.out.println("condition1");}catch(ArrayIndexOutOfBoundsExceptione){System.out.println("condition2");}catch(Exceptione){System.out.println("condition3"
5、);}finally{System.out.println("finally");}}WhichwilldisplayifoneMethodrunnormally?ADA.condition1B.condition2C.condition3D.finally(8)Giventhefollowingcode:publicclassTest{voidprintValue(intm){do{System.out.println("Thevalueis"+m);}while(--m>10);}publicstaticvoidmain(Stringarg[]){inti=10;Testt
6、=newTest();t.printValue(i);}}Whichwillbeoutput?CA.Thevalueis8B.Thevalueis9C.Thevalueis10D.Thevalueis11(9)Giventhefollowingcode:publicclassPerson{staticintarr[]=newint[10];publicstaticvoidmain(Stringa[]){System.out.println(arr[1];)}}Whichstatementiscorrect?CA.Whencompilationsomeerrorwilloccur
7、.B.Itiscorrectwhencompilationbutwillcauseerrorwhenrunning.C.Theoutputiszero.D.Theoutputisnull.(10)Giventhefollowingcode:Strings="hello";Stringt="hello";charc[]={'h','e','l','l','o'};Whichreturntrue?ADA.s.equals(t);B.t.equals(c);C.s==t;D.t.equals(ne
此文档下载收益归作者所有