欢迎来到天天文库
浏览记录
ID:39550174
大小:190.50 KB
页数:9页
时间:2019-07-06
《Java工程师面试题-answer》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、考试时间:1小时考题(Java软件工程师)姓名:学校: 专业: 学历:毕业时间: 手机电话: 邮件地址:一、选择题NO.11.interfaceFoo{2.intk=0;3.}4.5.publicclassTestimplementsFoo{6.publicstaticvoidmain(Stringargs[]){7.inti;8.Testtest=newTest();9.i=test.k;10.i=Test.k;ll.i=Foo.k;12.}13.}14.
2、Whatistheresult?a)Compilationsucceeds.b)Anerroratline2causescompilationtofail.c)Anerroratline9causescompilationtofail.d)Anerroratline10causescompilationtofail.e)Anerroratline11causescompilationtofail.Answer:(a)NO.21.publicclassTest{2.publicintaMethod(){3
3、.staticinti=0;4.i++;5.returni;6.}7.publicstaticvoidmain(Stringargs[]){8.Testtest=newTest();9.test.aMethod();l0.intj=test.aMethod();ll.System.out.println(j);92008校招试题考试时间:1小时12.}13.}Whatistheresult?()a)Compilationwillsucceedandtheprogramwillprint"0"b)Comp
4、ilationwillsucceedandtheprogramwillprint"1'c)Compilationwillsucceedandtheprogramwillprint"2"d)Compilationwillfail.Answer:(c、e)NO.3WhichofthefollowingstatementsistrueregardingMyServlet?()importjavax.servlet.*;importjavax.servlet.http.*:importjava.io.*;pub
5、licclassMyServletextendsHttpServletimplementsSingleThreadModel{StringmyName;publicvoidservice(HttpServletRequestreq,HttpServletResponseres)throwsServletException,IOException{response.setContentType("text/plain");PrintWriterout=res.getWriter();myName=req.
6、getParameter("name");sayHello(out);out.close();}publicvoidsayHello(PrintWriterout){out.println("Hello"+myName);}}a.)MyServletisthreadsafe.b.)MyServletisnotthreadsafebecausemyNameisaninstancevariable.c.)MyServletisnotthreadsafebecauseMyServletimplementsSi
7、ngleThreadModel.d.)Noneoftheabove.Answer:(a)NO.4What’stheclassnameofmaincontrollerinstruts?a)MainServletb)MainServletc)StrutsServletd)ActionServletAnswer:(d)92008校招试题考试时间:1小时NO.5WhichstatementiscorrectwhenanobjectispersistedtoDatabasewithhibernateframewo
8、rk?()Session.save(Objecto)Session.load(Objecto)Session.update(Objecto)Session.store(Objecto)Answer:(a)NO.6Whichpatternwouldyouusetocreateacomplexobjectandhavetheassemblyandpartsindependent?A.PrototypeB.SingletonC.BuilderD.
此文档下载收益归作者所有