欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    软件工程师试题41885.docx

    • 资源ID:48281127       资源大小:41.10KB        全文页数:24页
    • 资源格式: DOCX        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    软件工程师试题41885.docx

    一、 判断(10分,每题1分)1是对,2是错1、 System.gc()使Java虚拟机立刻执行垃圾回收。( 2)2、 JFrame是Frame的子类。( 1)3、 构造方法法不可以被pprivatte访问修饰饰符修饰。(22)4、 Striing a=new SStringg();与SStringg b = new SStringg()属于一一个对像。(2)5、 FileeChannnel类位于于java.io包中。(22)6、 接口是的的成员变量必必须显示的给给出初始值。(11)7、 absttract不不能与priivate、ffinal、sstaticc共同使用。(11)8、 成员变量量Booleean b;的默认值为为falsee。(1)9、 代表Seervlett生命周期的的三个方法为为:initt、execcute、ddestorry。(2)10、HttppSessiion的销毁毁方法为deestoryy。(2)二、单选(500分,每题11分)1、以下哪一个个包是默认导导入到Javva类当中的的(A)A、java.lang B、javva.ioC、java.nio DD、javaa.longg2、对于以下类类:Dpublic classs Q2 publicc stattic vooid maain(Sttring arggs) methodd();privatee stattic vooid meethod() Systemm.out.printtln("HHello"");A、编译失败,行3错误。 B、编译失失败,行5错错误。C、编译通过,无无运行结果。 D、打印HHello。3、以下哪个是是不正确的标标识符:DA、Abc3 B、a_bbc_3 CC、_3abbc D、33_abc4、局部变量bbooleaan的默认值值为:DA、falsee B、trrue C、nnull DD、无默认值值,必初始化化5、对于Perrson pp = neew Perrson();,以下哪哪个能编译通通过:CA、Objecct o = new Objecct(p); B、p = neww Objeect();C、booleean b = p iinstannceof Objecct; D、bbooleaan b = Objeect innstancceof pp;6、对于以下代代码,运行的的结果是:CCpublic classs Q6 int a=1; publicc stattic vooid maain(Sttring arggs) i+; +i; Systeem.outt.prinntln(ii);A、2 B、33 C、编译译出错 D、运运行出错7、对于booolean b = (2>=1 | 2/0>=0);b的结果果为:CA、falsee B、运行行出错,2/0抛出被00除错误 C、true D、nulll8、以下能编译译通过的foor循环是:CA、for(iint a,int bb;a<1000;a+) BB、for(int aa=0,innt b = 0;a<<100;)C、for(iint a=0,b=1100;a<<50;a+,b-)D、for(iint a=0,b=1100;a<<50,b>>50;a+,b-)9、对于方法ppublicc voidd a(innt a,SStringg b)以下哪一个个是它正确的的重载方法:CA、publiic intt a(innt a,SStringg b) B、prrotectted vooid a(int aa,Striing b)C、publiic intt a(innt a,SStringg b) D、ppublicc stattic vooid a(int aa,Striing b)10、以下哪一一个不是受检检查的异常类类:CA、SQLExxceptiion B、FFileNootfounndExceeptionnC、NullPPointeerExceeptionn D、IOOExcepption11、将一个对对像序列化的的方式是,使使此类实现以以下哪一个接接口:BA、Cloneeable B、SerrializzableC、File D、Excceptioon12、启动一个个线程应使用用线程类的:BA、run() B、sttart()C、go() D、thrread()13、以下哪一一个是正确初初始化数组的的方式:CA、int11 a = new int111; B、innt aa = neew intt111;C、int a = new iint1; DD、int1 a = neww int1;14、以下代码码输出的结果果是:Dpublic classs Q14 int a = 20; staticc int a = 10;public statiic voiid maiin(Strring argss) Q14 q114 = nnew Q114(); Systemm.out.printtln(q114.a);A、编译出错,变变量a重复定定义 B、运运行出错,qq14.a不不能确定是哪哪个变量aC、打印10 D、打印220。/静态代码块块可以不用创创建对象来调调用,可以直直接用类名加加方法名来调调用15、以下代码码编译/运行行结果为:CCpublic classs Q15 publicc stattic vooid maain(Sttring arggs) int ii=10; int jj = 100; booleean b = fallse; if(b= i = = j) /行66 Systeem.outt.prinntln(""true""); elsee Systeem.outt.prinntln(""falsee"); A、在第6行编编译出错 BB、在第6行行运行出错C、打印truue D、打打印falsse16、对于以下下代码,哪个个能编译通过过:Cpublic interrface Animaalpublic classs Dog impleementss Animmalpublic classs Cat impleementss AnimmalA、Dog ddog = new CCat(); B、Caat catt = neew Aniimal();C、Animaal catt = neew Dogg(); DD、Cat c = nnew Caat(); Dog dd = (DDog)c;17、对于以下下类,那一行行是正确的方方法覆盖:DDpublic classs Q17 publicc voidd methhod(innt a) throwws Excceptioonpublic classs Q17_A /在此输入入正确的一行行,A、void methood(intt a) B、vooid meethod(Strinng a)C、publiic intt methhod(innt a) D、ppublicc voidd methhod(innt a) throwws IOEExcepttion18、以下代码码输出的值为为:Bpublic classs Q18 Booleaan bboo = new BBooleaan1; Q18() Systemm.out.printtln(booo0);public statiic voiid maiin(Strring argss) new Q118();A、falsee B、nuull C、ttrue DD、运行出错错19、对于以下下代码,运行行结果为,即即a的值为:AHashMapp map = neww HashhMap();map.putt("a","Helllo");map.putt("a","Worlld");String a = mmap.geet("a"");A、最后一行编编译出错 BB、最后一行行运行出错。C、a的值为HHello D、a的值值为Worlld20、以下哪个个是jsp声声明:BA、<%= %> B、<<%! %>> C、<% %> DD<% %>21、在webb项目的Fiilter中中,通过以下下哪个方法能能获取webb.xml配配置的初始化化参数:BA、doFillter BB、initt C、deestoryy D、seervicee22、在webb项目中,日日志级别由高高到低为:CCA、ERRORR,FATAAL,INFFO,WARRN,DEBBUGB、FATALL,ERROOR,INFFO,WARRN,DEBBUGC、FATALL,ERROOR,WARRN,INFFO,DEBBUGD、WARN,EERROR,FFATAL,IINFO,DDEBUG23、以下代码码运行结果为为:public classs ForBBarpublic statiic voiid maiin(Strring argss) int ii=0,j=5; tp: ffor( ; ; i+) for ( ; ; -j) if (ii>j) bbreak tp; Systeem.outt.prinntln(""i="+ii+",j="+j); A 程序可以运运行并打印""i=1, j=-1""B 程序可以运运行并打印""i=1, j=4"C 程序可以运运行并打印""i=0, j=-1""D第4行有个错错误导致编译译失败24、哪个事件件类标识基于于一个pponentt的按键动作作?AA KeyEvventB. KeyDDownEvventC. KeyPPressEEventD. KeyTTypedEEvent25、如何得到到文件"fiile.txxt"的父目目录名字?BBA Strinng namme=Fille.gettParenntNamee("fille.txtt");B Strinng namme=(neew Fille("fiile.txxt").getPaarent();C Strinng namme=(neew Fille("fiile.txxt").getPaarentNName(); D Strring nname=(new FFile(ffile.ttxt).getPaarentFFile();26、以下哪一一个是正确处处理事务的开开始(connn是Connnectiion对像的的变量):( A ) A、connn.setAAutoCoommit(falsee); B、cconn.aautoCoommit = fallse; C、connn.setCCommitt(falsse); DD、connn.rolllback();27、以下哪一一个是antt中,将jaava文件编编译成claass文件的的内置任务:( C ) A、javaa B、coomplieer C、jjavac D、mkcclass28、以下哪一一个是正确的的将自定义标标签导入到jjsp页面上上:( B ) A、<% page uri=""/aa.ttld" pprefixx="aa""%> B、<% tagliib urii="/aaa.tld"" preffix="aaa"%> C、<% incluude urri="/aa.tld"" preffix="aaa"%> D、<% ttaglibb uri="/a.ttld" pprefixx="aa""%>29jsp页面面上有以下语语句<% rrequesst.settAttriibute("helllo","HHelloWWorld"");%>,取取出并正确输输出到页面的的方法为:CC A、<% SStringg helllo = rrequesst.gettAttriibute("helllo"); out.pprint(helloo);%> B、<% SStringg helllo = rrequesst.gettParammeter("helllo");oout.prrint(hhello);%> C、<% SStringg helllo = (Strinng)reqquest.getAtttribuute("hhello""); ouut.priint(heello);%> D、<%=rrequesst.gettAttriibute("helllo"); %>30、以下是一一段javaascrippt脚本,请请问最后i的的值是多少:( B ) functiion abbc() for(vaar i=00;i<100;i+) alert(i); /此处i的的值是多少?A、 运行出错错,因为i在在for之外外不能访问B、 提示100 C、提示示11 D、提提示nulll或是unddefainned31、PrepparedSStatemment或是是Stateement执执行批处理eexecutteBatcch()后返返回以下哪种种数据类型:( C )A、int类型型 B、boooleann类型 C、iint类类型 D、vvoid类型型32、看以下代代码,说出结结果:B publicc voidd a() throwws Excceptioon try int a = 0; int b = 0; int c = a/bb; (行55)catch(Excepption e) e.prinntStacckTracce();A:编译出错,不不能try与与throwws共同使用用 B:运行行出错在第55行C:不打出任何何结果 D:运行不出错错。也不出结结果。33、以下代码码:B publicc voidd a() try int a = 0/00; /行行3catch(Excepption e)/行4 Systemm.err.printtln("eerror"");/出出错,行5catch(ArithhmeticcExcepption e)/行6 Systemm.err.printtln("/ by zzero");/被00除错误,行行7A:编译出错在在第4行。 B:编译出出错在第6行行。B:编译通过,打打出errrro D:编编译通过,打打出/ byy zeroo.34、以下程序序运行的结果果为:C publicc voidd abc() try returrn; catchh(Exceeptionn e)/行4finallly Systemm.err.printtln("ffinallly");/行6A:编译出错在在第4行。 B:运行不不打出任何结结果 C:运行打出ffinallly D:编编译出错在第第6行。35、垃圾回收收的时间说哪哪个正确:CC A:Systtem.gcc()时执行行 B:Ruuntimee.getRRuntimme().ggc()时执执行 C:不确定 D:CPUU空闲时执行行36、当子类中中的内部类与与父类中的内内部类同名时时:D A:子类复盖盖了父类的内内部类 B:编译出错 C:运行出错错 D:各自自拥有自己的的内部类,互互不影响37、对于以下下代码,运行行打印什么结结果:D class RunHaandlerr publicc voidd run() Systemm.out.printtln("rrun");public classs Testter publicc stattic vooid maain(Sttring arggs) Threaad t = new Threaad(neww RunHHandleer(); t.staart();A:打印runn B:不打打印任何内容容 C:运行行出错 D:编译出错38、创建FiileChaannel的的方式,以下下哪一个是正正确的:C A:FileeChannnel f = neww FileeChannnel() B:FilleChannnel ff = FiileChaannel.getChhannell(); C:FileeChannnel f = neww InpuutStreeam("dd:/a.ttxt").getFiileChaannel(); D:FileeChannnel f = neww FileeOutpuutStreeam("dd:/a.ttxt").getChhannell();39、取消JFFrame framee = neew JFrrame()的默认布居居管理器的方方式是:C A:framme.settLayouut(""); B:fframe.setLaayout("nonee"); C:framme.settLayouut(nulll); DD:framme.delleteLaayout();40、以下哪一一个是正确了了使用BiggDecimmal b = neww BigDDecimaal(10)对像的加方方法:C :b = b +100 B:b = b.aadd(100) :b = b.addd(new BigDeecimall(10); D:b +=10;41、JFraame是以下下哪个类的子子类:B A:JCommponennt B:FFrame C:JPaanel DD:JAppplet42、继承使用用( B)关关键字,实现现一个接口,使使用( )关关键字? A:impllementts、exttends B:exttends、iimplemments C:exteends、sstaticc D:immplemeents、aabstraact43、方法puublic void abc(iint a),以下下哪一个是它它的重载方法法( C) A:privvate vvoid aa() B:priivate int aabc(innt a) C:publlic innt abcc(int a,Strring nname) D:privvate vvoid aabc(innt a)44、局部变量量可以被下列列哪一个修饰饰( C) A:publlic B:synchhronizzed C:finaal D:nnativee45、doubble d = 0.00/0 的结结果是:( D) A:正无穷大大 B:不能能编译 C:运行出错 D:NaNN46、声明成员员变量:puublic finall Striing naame;后,直直接输出,结结果为:(AA) A:nulll B:NUULL C:空 D:编编译出错47、接口当中中,所有的成成员变量默认认都是:C A:publlic abbstracct类型 BB:publlic abbstracct finnal类型 C:publlic sttatic finall类型 D:privaate类型48、接口中的的方法默认都都是:(C ) A:prottetcteed类型。 B:pubblic aabstraact fiinal类型型。 C:publlic abbstracct类型 DD:prottectedd absttract类类型49、在子类中中,声明了同同父类相同名名称的成员变变量,此时要要引用父类的的成员变量,可可以使用关键键字:( CC ) A:thiss B:abbstracct C:ssuper D:parrent50、在一个接接口当中,只只定义很多常常量,不包含含任何的方法法,这种模式式叫做:(BB ) A:代理模式式 B:常量量接口模式 C:标识模模式 D:适适配器模式三、多选(300分,每题22分)1、this关关键字可以使使用在以下哪哪些方法中:ACA、构造方法 B、成员静静态方法 CC、成员非静静态方法 DD、stattic代码块块2、以下哪些能能编译通过:BCA、char a = 33C; B、llong aa = 1223L;C、doublle a = 23.44D; D、ffloat f = 223.4;3、对于Strring aa = "HHello"" Strring bb = "HHello""以下哪些些对比为trrue值:AABCDA、booleean booo = (a=b); B、bbooleaan booo = (aa.equaals(b);C、booleean booo = (a.toSStringg()=bb.toSttring(); D、booleean booo = (a.toSStringg().eqquals(b.toSStringg();4、对于以下接接中和类,哪哪些是正确的的继承(实现现)的代码:Cpublic interrface Q4_1public interrface Q4_2public abstrract cclass Q4_3A、 publlic cllass QQ4_5 eextendds Q4_1,Q4_2,Q4_3B、 publlic cllass QQ4_5 iimplemments Q4_1,Q4_2,Q4_3C、 publlic cllass QQ4_5 eextendds Q4_3 impplemennts Q44_1,Q44_2D、 publlic cllass QQ4_5 eextendds Q4_1,Q4_2 impplemennts Q44_35、不能被子类类覆盖的方法法有:ADA、privaate方法 B、absstractt方法C、publiic方法 DD、finaal方法6、以下哪种类类不能拥有了了类:ADA、使用finnal修饰的的类 B、使使用stattic修饰的的类C、使用finnal修饰的的构造方法的的类 D、使使用privvate修饰饰构造方法的的类7、以下哪些创创建类的方式式会调用类的的构造方法:ACA、使用neww关键字 BB、调用对像像的clonne()方法法。C、使用Claass.foorNamee("SommeCls"").newwInstaance();D、使用反序列列化方式8、以下哪些是是正确的:AABCDA、内部类可以以定义成fiinal类型型。B、内部类可以以定义成prrivatee类型。C、内部类可以以实现多个接接口。D、内部类可以以访问外部类类所有finnal类型的的变量。9、以下Serrvlet的的哪些方法会会响应htttp的gett请求:ACCA、serviice B、ddoPosttC、doGett D、exxecutee10、以下哪些些是JavaaBean的的特点:BCCADA、拥有公开的的构造方法 B、所有的的成员变量为为privaate类型C、提供gettters和和setteers方法 D、对于bbooleaan类型,提提供isXxxxx方法11、哪两个直直接导致线程程停止执行?DBA 从一个同步步块跳出 B 基于一个个对象调用wwait方法法 C基于一个对对象调用nootify方方法D 基于一个线线程对象调用用setPrrioritty方法12、哪两个接接口提供用键键值对存储数数据的功能? (2个正正确答案)AAD A Map B Set C SorttedSett D SorttedMapp13、哪个正确确创建整型二二维数组?(3个答案)BCDA. int a = neew intt;B. int a = neew intt1010;C. int aa = neew intt1010;D. int a = neew intt1010;14、对于jssp声明说法法正确的是:DCA、在jsp声声明中,只能能声明变量 B、在jssp声明中,只只能声明方法法C、在jsp声声明中,可以以声明静态变变量 D、在jsp声声明时,即可可以声明方法法、也可以声声明变量15、在以下代代码横线处加加入哪些异常常可以让程序序编译通过:( ) pulic void queryy() thhrows _ACB_ Statemment sst = CConn.ggetConnn().ccreateeStateement(); /获取数据操操作对像 ResulttSet rrs = sst.exeecuteQQuery("seleect * from stud"");A、Excepption B、ThrrowablleC、SQLExxceptiion D、RRuntimmeExceeptionn四、综合题(110分,每题题10分)请书写一个字符符过虑器Fiilter,对对某个webb项目中的所所有url都都应用GBKK格式的编码码。并正确配配置到webb.xml中中(10分)<!- 配置置过滤器 -> <filtter> <filtter-naame>SeetCharracterrEncodding</filteer-namme> <filtter-cllass>uutil.SSetEnccodinggFilteer</fiilter-classs> <initt-paraam> <paraam-namme>enccodingg</parram-naame> <paraam-vallue>uttf-8</paramm-valuue> </iniit-parram> </fillter> <filtter-maappingg> <filtter-naame>SeetCharracterrEncodding</filteer-namme> <url-patteern>/*</urll-patttern> </fillter-mmappinng>packagee utill;import javaxx.servvlet.FFilterr; import javaxx.servvlet.FFilterrConfiig; import javaxx.servvlet.SServleetExceeptionn; import javaxx.servvlet.SServleetRequuest; import javaxx.servvlet.SServleetRespponse; import javaxx.servvlet.FFilterrChainn; import java.io.IOOExcepption; /* * Filteer thaat setts thee charracterr encooding to bee usedd in pparsinng thee * incomming rrequesst, eiither unconnditioonallyy or oonly iif thee clieent diid nott * speciify a charaacter encodding. Confiigurattion oof thiis fillter iis bassed onn * the ffollowwing iinitiaalizattion pparameeters: * * encodding - The charaacter encodding tto be confiiguredd * for tthis rrequesst, eiither condiitionaally oor unccondittionallly baased oon * the iignoree inittializzationn paraameterr. Thiis parrameteer * is reequireed, soo therre is no deefaultt. * * ignorre - IIf sett to ""true"", anyy charracterr encooding * speciified by thhe cliient iis ignnored, and the vvalue returrned bby thee * selecctEncooding() metthod iis sett. If set tto "faalse, * selecctEncooding() is calleed onlly if the * cliennt hass not alreaady sppecifiied ann encooding. By ddefaullt, thhis * parammeter is seet to "truee". * * Althoough tthis ffilterr can be ussed unnchangged, iit is also easy to * subcllass iit andd makee the selecctEncooding() metthod mmore * intellligennt aboout whhat enncodinng to choosse, baased oon chaaracteeristiics off * the iincomiing reequestt (succh as the vvaluess of tthe Acccept-Languuage * and UUser-AAgent headeers, oor a vvalue stashhed inn the curreent * user''s sesssion. */ public classs SetEEncodiingFillter iimplemments Filteer / - IInstannce Vaariablles /* * Thee defaault ccharaccter eencodiing too set for rrequessts thhat paass thhroughh thiss filtter. */ proteected Strinng enccodingg = nuull; /* * Thee filtter coonfiguuratioon objject wwe aree assoociateed witth. * If this valuee is nnull, this filteer insstancee is nnot cuurrenttly coonfiguured. */ proteected FilteerConffig fiilterCConfigg = nuull; /* * Shoould aa charracterr encooding speciified by thhe cliient bbe ignnored? */ proteected booleean iggnore = truue; / - PPublicc Methhods /* * Plaace thhis fiilter into serviice. * * paaram ffilterrConfiig Thee filtter coonfiguuratioon objject */ publiic voiid iniit(FillterCoonfig filteerConffig) tthrowss ServvletExxceptiion this.filteerConffig = filteerConffig; this.encodding = filtterConnfig.ggetIniitParaameterr("enccodingg"); Strinng vallue = filteerConffig.geetInittParammeter("ignoore"); if (vvalue = nuull) this.ignorre = ttrue; else if (vvalue.eq

    注意事项

    本文(软件工程师试题41885.docx)为本站会员(you****now)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开