欢迎来到天天文库
浏览记录
ID:39428652
大小:57.50 KB
页数:10页
时间:2019-07-03
《华为公司招聘java程序员面试题-JAVA程序员JAVA工程师面试必看》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、-JAVA程序员JAVA工程师面试必看第一部分:选择题 QUESTIONNO:1 1、publicclassTest{ publicstaticvoidchangeStr(Stringstr){ str="welcome"; } publicstaticvoidmain(String[]args){ Stringstr="1234"; changeStr(str); System.out.println(str); } } Pleasewritetheoutputresult:
2、 QUESTIONNO:2 1.publicclassTest{ 2.staticbooleanfoo(charc){ 3.System.out.print(c); 4.returntrue; 5.} 6.publicstaticvoidmain(String[]argv){ 7.inti=0; 8.for(foo('A');foo('B')&&(i<2);foo('C')){ 9.i++; 10.foo('D'); 12.} 13.} 14.} Whatistheres
3、ult? A.ABDCBDCB B.ABCDABCD C.Compilationfails. D.Anexceptionisthrownatruntime.QUESTIONNO:3 1.classA{ 2.protectedintmethod1(inta,intb){return0;} 3.} WhichtwoarevalidinaclassthatextendsclassA?(Choosetwo) A.publicintmethod1(inta,intb){return0;} B
4、.privateintmethod1(inta,intb){return0;} C.privateintmethod1(inta,longb){return0;} D.publicshortmethod1(inta,intb){return0;} E.staticprotectedintmethod1(inta,intb){return0;} QUESTIONNO:4 1.publicclassOuter{ 2.publicvoidsomeOuterMethod(){ 3.//Line3
5、 4.} 5.publicclassInner{} 6.publicstaticvoidmain(String[]argv){ 7.Outero=newOuter(); 8.//Line8 9.} 10.} WhichinstantiatesaninstanceofInner? A.newInner();//Atline3 B.newInner();//Atline8 C.newo.Inner();//Atline8 D.newOuter.Inner();//Atline8//
6、newOuter().newInner() QUESTIONNO:5 WhichmethodisusedbyaservlettoplaceitssessionIDinaURLthatiswrittentotheservlet’sresponseoutputstream? A.TheencodeURLmethodoftheHttpServletRequestinterface. B.TheencodeURLmethodoftheHttpServletResponseinterface. C.T
7、herewriteURLmethodoftheHttpServletRequestinterface. D.TherewriteURLmethodoftheHttpServletResponseinterface.QUESTIONNO:6 Whichtwoareequivalent?(Choosetwo) A. B. C. D. E. F. G. QUESTIONNO:7 Whichofthefollowingstatementsregardingthelifecycleofas
8、essionbeanarecorrect? 1.java.lang.IllegalStateExceptionisthrownifSessionContext.getEJBObject()isinvokedwhenastatefulsessionbeaninstanceispassivated. 2.SessionContext.getRollbackOnly()doesnotthrowanexceptionwhenasessionbeanwithb
此文档下载收益归作者所有