java工程師面試題_第1頁
java工程師面試題_第2頁
java工程師面試題_第3頁
java工程師面試題_第4頁
java工程師面試題_第5頁
已閱讀5頁,還剩7頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

西安三元數(shù)碼軟件有限公司外派JAVA軟件工程師筆試題4303返回上級目錄選擇題1:在軟件生命周期中,下列哪個說法是不準(zhǔn)確的?軟件生命周期分為計(jì)劃、開發(fā)和運(yùn)行三個階段在計(jì)劃階段要進(jìn)行問題焉醛和需求分析在開發(fā)后期要進(jìn)行編寫代碼和軟件測試在運(yùn)行階段主要是進(jìn)行軟件維護(hù)2:publicclassParent(intchange(){...}}classChildextendsParent(}WhichmethodscanbeaddedintoclassChild?r publicintchange()(} abstractintchang()(}rprivateintchange()(}rnone3:Givethefollowingmethod:publicvoidmethod()(Stringa,b;a=newString(“helloworld”);b=newString(“gameover”);System.out.println(a+b+”ok”);a=null;

a=b;System.out.println(a);}Intheabsenceofcompileroptimization,whichistheearliestpointtheobjectareferedisdefinitelyelibiletobegarbagecollection.beforeline5beforeline6beforeline7beforeline94:Strings="ExampleString”;Whichoperationisnotlegal?Cinti=s.length();s[3]=”x”;「一 Stringshort_s=s.trim();CStringt="root"+s;5:關(guān)于垃圾收集的哪些敘述是對的。程序開發(fā)者必須自己創(chuàng)建一個線程進(jìn)行內(nèi)存釋放的工作。垃圾收集將檢查并釋放不再使用的內(nèi)存。垃圾收集允許程序開發(fā)者明確指定并立即釋放該內(nèi)存。垃圾收集能夠在期望的時間釋放被java對象使用的內(nèi)存。6:Givethefollowingcode:publicclassExample(publicstaticvoidmain(Stringargs[])(intl=0;do(System.out.println("Doingitforlis:”+l);}while(--l>0)System.out.println("Finish”);

}}WhichwellbeoutputDoingitforlis3rDoingitforlis1CDoingitforlis2CDoingitforlis07:Whichofthefollowingstatementsaretrue?rTheautomaticgarbagecollectionoftheJVMpreventsprogramsfromeverrunningoutofmemoryrAprogramcansuggestthatgarbagecollectionbeperformedandforceitCGarbagecollectionisplatformindependentCAnobjectbecomeseligibleforgarbagecollectionwhenallreferencesdenotingitaresettonull.8:下面關(guān)于變量及其范圍的陳述哪些是錯的。實(shí)例變量是類的成員變量。實(shí)例變量用關(guān)鍵字static聲明。在方法中定義的局部變量在該方法被執(zhí)行時創(chuàng)建局部變量在使用前必須被初始化。9:Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode?2.(Assumethatthecodeiscompiledandrunwithassertionsenabled)4.1.importjava.util.*;.publicclassAssertTest10.

(12.privateHashMapcctld;6.publicAssertTest()18.(20.cctld=newHashMap();22.cctld.put("in”,"India");24.cctld.put("uk”,"UnitedKingdom");26.cctld.put("au”,"Australia");28.//morecode...30.}32.//othermethods34.publicStringgetCountry(StringcountryCode)36.(38.//Whatshouldbeinsertedhere?40.Stringcountry=(String)cctld.get(countryCode);42.returncountry;44.}46.}assertcountryCode!=null;assertcountryCode!=null:"Countrycodecannotbenull";assertcctld!=null:"Nocountrycodedataisavailable";

assertcctld:"Nocountrycodedataisavailable";10:在下述選項(xiàng)時,沒有構(gòu)成死循環(huán)的程序是Cinti=100while(1)(i=i%100+1;if(i>100)break;}for(;;);intk=1000;do{++k;}while(k>=10000);rints=36;while(s);--s;11:給出下面的代碼片斷。。。下面的哪些陳述為錯誤的?1)publicvoidcreate(){2)VectormyVect;3)myVect=newVector();4)}第二行的聲明不會為變量myVect分配內(nèi)存空間。第二行語句創(chuàng)建一個Vector類對象。第三行語句創(chuàng)建一個Vector類對象。第三行語句為一個Vector類對象分配內(nèi)存空間12:Aclassdesignrequiresthatamembervariableshouldbeaccessibleonlybysamepackage,whichmodiferwordshouldbeused?CprotectedpublicC-nomodiferprivate13:Givethefollowingjavasourcefragement://pointxpublicclassInteresting{//dosomething}WhichstatementiscorrectlyJavasyntaxatpointx?

publicclassMyClass(//dootherthing...}staticintPI=3.14classMyClass(//dosomething.}Ccnone14:WhichfragmentsarenotcorrectinJavasourcefile?rpackagetestpackage;publicclassTest{//dosomething...}rimportjava.io.*;packagetestpackage;publicclassTest{//dosomething...}「一 .一 r importjava.io.*;classPerson{//dosomething...}publicclassTest{//dosomething...}「…..?….. importjava.io.*;importjava.awt.*;publicclassTest{//dosomething...}15:以下的C程序代碼片段運(yùn)行后C和d的值分別是多少Inta=1,b=2;Intc,d;c=(a&b)&&a;d=(a&&b)&a;TOC\o"1-5"\h\z0,0C0,1c1,0r1,116:Whatwillbetheresultofexecutingthefollowingcode?2.publicstaticvoidmain(Stringargs[])TOC\o"1-5"\h\z{chardigit='a';for(inti=0;i<10;i++){switch(digit){case'x':{intj=0;

System.out.println(j);TOC\o"1-5"\h\z}default:(intj =100;System.out.println(j);}}}inti=j;System.out.println(i);}25.Choices:100willbeprinted11times.「一 Thecodewillnotcompilebecausethevariableicannotbedeclaredtwicewithinthemain()method.CThecodewillnotcompilebecausethevariablejcannotbedeclaredtwicewithintheswitchstatement.CNoneofthese.17:Givethisclassoutline:classExample(privateintx;//restofclassbody…}AssumingthatxinvokedbythecodejavaExample,whichstatementcanmadexbedirectlyaccessibleinmain()methodofExample.java?CChangeprivateintxtopublicintxchangeprivateintxtostaticintx「一 ChangeprivateintxtoprotectedintxCchangeprivateintxtofinalintx18:WhicharenotJavakeywords?

TRUEconstsupervoid19:設(shè)有變量說明語句inta=1,b=0;則執(zhí)行以下程序段的輸出結(jié)果為()。switch(a){case1:switch(b){case0:printf("**0**");break;case1:printf("**1**");break;}case2:printf("**2**");break;}printf("\n");r**0**c**0****2**C.**0****1****2**C.**0****1****2**D.有語法錯誤20:軟件生命周期的瀑布模型把軟件項(xiàng)目分為3個階段、8個子階段,以下哪一個是正常的開發(fā)順序?計(jì)劃階段、開發(fā)階段、運(yùn)行階段設(shè)計(jì)階段、開發(fā)階段、編碼階段設(shè)計(jì)階段、編碼階段、維護(hù)階段計(jì)劃階段、編碼階段、測試階段21:Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?2.3.classBase

{6.inti=99;8.publicvoidamethod()10.TOC\o"1-5"\h\z{12.System.out.println("Base.amethod()”);14.}16.Base()18.{20.amethod();22.}24.}26.publicclassDerivedextendsBase28.{30.inti=-1;32.33.34.publicstaticvoidmain(Stringargv[])36.{38.Baseb=newDerived();40.System.out.println(b.i);42.b.amethod();44.}46.publicvoidamethod()

48.TOC\o"1-5"\h\z(50

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論