欢迎来到天天文库
浏览记录
ID:15845192
大小:49.50 KB
页数:5页
时间:2018-08-06
《济南公司面试题(浪潮,中创等大公司)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、面试测试题2(一)、选择题(4′×10):(1)Whichofthefollowingrangeofshortiscorrect?CA.-27~27-1B.0~216-1C.-215~215-1D.-231~231-1(3)Giventhefollowingcode:C1:publicvoidmodify(){2:inti,j,k;3:i=100;4:while(i>0){5:j=i*2;6:System.out.println("Thevalueofjis"+j);7:k=k+1;8:i--;9:}10:}Whichlinemightcauseanerror
2、duringcompilation?CA.line4B.line6C.line7D.line8(4)Whichofthefollowingansweriscorrecttoexpressthevalue8inoctalnumber?AA.010B.0x10C.08D.0x8(5)WhicharenotJavakeywords?ABA.TRUEB.sizeofC.constD.superE.void(6)Giventhefollowingcode:1:classPerson{2:publicvoidprintValue(inti,intj){//...}3:pu
3、blicvoidprintValue(inti){//...}4:}5:publicclassTeacherextendsPerson{6:publicvoidprintValue(){//...}7:publicvoidprintValue(inti){//...}8:publicstaticvoidmain(Stringargs[]){9:Persont=newTeacher();10:t.printValue(10);11:}12:}Whichmethodwillthestatementonline10call?DA.online2B.online3C.
4、online6D.online75(7)Giventhefollowingcode:publicvoidtest(){try{oneMethod();System.out.println("condition1");}catch(ArrayIndexOutOfBoundsExceptione){System.out.println("condition2");}catch(Exceptione){System.out.println("condition3");}finally{System.out.println("finally");}}Whichwill
5、displayifoneMethodrunnormally?ADA.condition1B.condition2C.condition3D.finally(8)Giventhefollowingcode:publicclassTest{voidprintValue(intm){do{System.out.println("Thevalueis"+m);}while(--m>10);}publicstaticvoidmain(Stringarg[]){inti=10;Testt=newTest();t.printValue(i);}}Whichwillbeout
6、put?CA.Thevalueis8B.Thevalueis9C.Thevalueis10D.Thevalueis11(9)Giventhefollowingcode:publicclassPerson{staticintarr[]=newint[10];publicstaticvoidmain(Stringa[]){System.out.println(arr[1];)}}Whichstatementiscorrect?CA.Whencompilationsomeerrorwilloccur.B.Itiscorrectwhencompilationbutwi
7、llcauseerrorwhenrunning.C.Theoutputiszero.D.Theoutputisnull.5(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(newString("hello"));E.t==c.(二)、填空题(4′×5):(2)、递归函数sum(inta[],intn)的返回值是
8、数组a[]的前n个元素之和intsum
此文档下载收益归作者所有