欢迎来到天天文库
浏览记录
ID:16270314
大小:91.50 KB
页数:27页
时间:2018-08-08
《java程序员面试题》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、java程序员面试题第一部分:选择题 QUESTIONNO:1 1、publicclassTest{ publicstaticvoidchangeStr(Stringstr){ str="welcome";九塾教育http://rooms9.com } publicstaticvoidmain(String[]args){ Stringstr="1234"; changeStr(str); System.out.println(str); } } Pleasewritetheoutputresult: QUESTIONNO:2 1.publiccl
2、assTest{ 2.staticbooleanfoo(charc){ 3.System.out.print(c);九塾教育http://rooms9.com 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.}九塾教育http://rooms9.com 14.} Whatistheresult? A.ABDCBDCB B.AB
3、CDABCD 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
4、(inta,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.//Line
5、8 9.}九塾教育http://rooms9.com 10.} WhichinstantiatesaninstanceofInner? A.newInner();//Atline3 B.newInner();//Atline8 C.newo.Inner();//Atline8 D.newOuter.Inner();//Atline8//newOuter().newInner() QUESTIONNO:5 WhichmethodisusedbyaservlettoplaceitssessionIDinaURLthatiswrittentotheservlet’
6、sresponseoutputstream? A.TheencodeURLmethodoftheHttpServletRequestinterface. B.TheencodeURLmethodoftheHttpServletResponseinterface. C.TherewriteURLmethodoftheHttpServletRequestinterface. D.TherewriteURLmethodoftheHttpServletResponseinterface.QUESTIONNO:6 Whichtwoareequivalent?(Choosetw
7、o) A. B. C. D. E. F. G. QUESTIONNO:7 Whichofthefollowingstatementsregardingthelifecycleofasessionbeanarecorrect? 1.java.lang.IllegalStateExceptionisthrownifSessionContext.getEJBObject()isinvokedwhenastatefulsessionbeaninstanceispassivated. 2.S
此文档下载收益归作者所有