欢迎来到天天文库
浏览记录
ID:42073260
大小:47.50 KB
页数:5页
时间:2019-09-07
《华为招聘Java面试题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、华为招聘Java面试题:概念题:1.描述Struts体系结构?对应各个部分的开发工作主要包括哪些?2.JSP有哪些内置对象和动作?它们的作用分别是什么?…… 第一部分:选择题 QUESTIONNO:1 1、publicclassTest{ publicstaticvoidchangeStr(Stringstr){ str="welcome"; } publicstaticvoidmain(String[]args){ Stringstr="1234"; changeStr(str); System.out.println(str); } } Pleasewri
2、tetheoutputresult: 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.} Whatistheresult? A.ABDCBDCB B.ABCDA
3、BCD C.Compilationfails. D.Anexceptionisthrownatruntime. QUESTIONNO:3 1.classA{ 2.protectedintmethod1(inta,intb){return0;} 3.} WhichtwoarevalidinaclassthatextendsclassA?(Choosetwo) A.publicintmethod1(inta,intb){return0;} B.privateintmethod1(inta,intb){return0;} C.privateintmethod1(inta,
4、longb){return0;} D.publicshortmethod1(inta,intb){return0;} E.staticprotectedintmethod1(inta,intb){return0;} QUESTIONNO:4 1.publicclassOuter{ 2.publicvoidsomeOuterMethod(){ 3.//Line3 4.} 5.publicclassInner{} 6.publicstaticvoidmain(String[]argv){ 7.Outero=newOuter(); 8.//Line8 9.} 10.
5、} WhichinstantiatesaninstanceofInner? A.newInner();//Atline3 B.newInner();//Atline8 C.newo.Inner();//Atline8 D.newOuter.Inner();//Atline8//newOuter().newInner() QUESTIONNO:5 WhichmethodisusedbyaservlettoplaceitssessionIDinaURLthatiswrittentotheservlet’sresponseoutputstream? A.TheencodeUR
6、LmethodoftheHttpServletRequestinterface. B.TheencodeURLmethodoftheHttpServletResponseinterface. C.TherewriteURLmethodoftheHttpServletRequestinterface. D.TherewriteURLmethodoftheHttpServletResponseinterface. QUESTIONNO:6 Whichtwoareequivalent?(Choosetwo) A.<%=YoshiBean.size%> B.<%=YoshiBea
7、n.getSize()%> C.<%=YoshiBean.getProperty("size")%> D. E. F.
此文档下载收益归作者所有