2024年Java認(rèn)證筆試歷年真題薈萃含答案_第1頁(yè)
2024年Java認(rèn)證筆試歷年真題薈萃含答案_第2頁(yè)
2024年Java認(rèn)證筆試歷年真題薈萃含答案_第3頁(yè)
2024年Java認(rèn)證筆試歷年真題薈萃含答案_第4頁(yè)
2024年Java認(rèn)證筆試歷年真題薈萃含答案_第5頁(yè)
已閱讀5頁(yè),還剩20頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

2024年Java認(rèn)證筆試歷年真題薈萃含答案(圖片大小可自由調(diào)整)答案解析附后卷I一.參考題庫(kù)(共25題)1.class?Rectangle?{?? public?static?void?main(String?[]?args)?{?? int?[]?x?=?{1,2,3};?? x[1]?=?(x[1]?〉?1)???x[2]?:?0;?? System.out.println(x[1]);?? }?? }?? 結(jié)果為:()??A、0B、1C、2D、32.Which?code,?inserted?at?line?14,?allows?the?Sprite?class?to?compile?() A、Direction?d?=?NORTH;B、Nav.Direction?d?=?NORTH;C、Direction?d?=?Direction.NORTH;D、Nav.Direction?d?=?Nav.Direction.NORTH;3.public?class?TestApp{?? public?static?void?main(String[]?args){?? try{?? String?myname?=?null;?? if(myname.length()>2)?? System.out.print(“1”);?? }catch(NullPointerException?e){?? System.out.print(“2”);??}??}??}?? 上述程序運(yùn)行后的輸出是哪項(xiàng)?()?A、?1B、?12C、?21D、?24.現(xiàn)有:? class?Thread2?implements?Runnable??{????? void?run()??{????? System.out.print?("go¨);????? }????? public?static?void?main(String??[]??args)??{??????? Thread2?t2=new?Thread2();????? Thread?t=new?Thread(t2);????? t.start();????? }????? }????? 結(jié)果為:()????A、goB、運(yùn)行時(shí)異常被拋出C、代碼運(yùn)行,無(wú)輸出結(jié)果D、編譯失敗5.現(xiàn)有:? 1.?interface?Animal?{? 2.?void?eat();? 3.?}? 4.? 5.?//?insert?code?here? 6.? 7.?public?class?HouseCat?extends?Feline?{? 8.?public?void?eat()?{?}? 9.?}?? 和五個(gè)聲明:? abstract?class?Feline?implements?Animal?{?}? abstract?class?Feline?implements?Animal?{?void?eat();?}? abstract?class?Feline?implements?Animal?{?public?void?eat();?}? abstract?class?Feline?implements?Animal?{?public?void?eat()?{?}?}? abstract?class?Feline?implements?Animal?{?abstract?public?void?eat();?}? 分別插入到第5行,有幾個(gè)可以通過(guò)編譯?()?A、0B、1C、2D、36.Given?that?a?scoped?attribute?cart?exist?only?in?a?user’s?session,?which?two,?taken?independently,?ensure?the?scoped?attribute?cart?no?longer?exists?()A、?${cart?=?null?}?B、??C、??D、??E、?cartF、??G、?${cart}7.public?class?Pet{???? private?String?name;???? public?Pet(){? System.out.print(1);????}? public?Pet(String?name){??????? System.out.print(2);????}?}? public?class?Dog?extends?Pet{???? public?Dog(){? System.out.print(4);????}? public?Dog(String?name){??????? this();? System.out.print(3);????}?}? 執(zhí)行new?Dog(“棕熊”);后程序輸出是哪項(xiàng)?()??A、?143B、?423C、?243D、?11348.Which?two?are?characteristics?of?the?Service?Locator?pattern?()A、It?encapsulates?component?lookup?procedures.B、It?increases?source?code?duplication?and?decreases?reuse.C、It?improves?client?performance?by?caching?context?and?factory?objects.D、It?degrades?network?performance?due?to?increased?access?to?distributed?lookup?services.9.Click?the?Exhibit?button. Given?the?JSP?code: 1. 5. Which?two,?inserted?at?line?5,?output?the?name?of?the?product?in?the?response?()A、 B、?C、?D、10.public?class?Employee{?? private?String?name;?? public?Employee(String?name){?? ?=?name;??}?? public?String?getName(){?? return?name;??}??}?? public?class?Manager?extends?Employee{?? private?String?department;?? public?Manager(String?name,String?department){?? this.department?=?department;?? super(name);?(應(yīng)于上一行掉位置)?? System.out.println(getName());??}??}?? Super的位置是否在方法的首行?? 執(zhí)行語(yǔ)句new?Manager(“smith”,”SALES”)后程序的輸出是哪項(xiàng)?()A、?smithB、?nullC、?SALESD、?編譯錯(cuò)誤11.Assume?the?tag?handler?for?a?st:simple?tag?extends?SimpleTagSupport. In?what?way?can?scriptlet?code?beused?in?the?body?of?st:simple?()A、Set?the?body?content?type?to?JSP?in?the?TLDB、Scriptlet?code?is?NOT?legal?in?the?body?of?st:simple.C、Add?scripting-enabled="true"?to?the?start?tag?for?the?st:simple?elementD、Add?a?pass-through?Classic?tag?with?a?body?content?type?of?JSP?to?the?body?of?st:simple,?and?place?thescriptlet?code?in?the?body?of?that?tag12.String?s=?"hello";???? String?t?=?"hello";? char?c[]?=?{’h’,’e’,’l’,’l’,’o’}?;???? Which?return?true?()???A、?s.equals(t);B、?t.equals(c);C、?s==t;D、?t.equals(new?String("hello"));E、?t==c;13.求四位的水仙花數(shù)。即滿足這樣條樣的四位數(shù):各位數(shù)字的4次方和等于該數(shù)自身。14.Java語(yǔ)言中表達(dá)式-12>>3?的結(jié)果是哪項(xiàng)?()?(12的二進(jìn)制00001100,-12的二進(jìn)制11110100)??A、?-4B、?-9C、?-1D、?-215.以下關(guān)于Java包的描述中,錯(cuò)誤的是()A、有利于程序的模塊與各個(gè)模塊的重復(fù)使用B、包是由一系列類(lèi)和接口所組成的具有一定功能的集合C、一個(gè)包就是一個(gè)源文件D、兩個(gè)類(lèi)如果名字相同,只要所屬的包不同,Java就會(huì)認(rèn)為它們是不同類(lèi)16.一下關(guān)于內(nèi)容窗格的描述中,正確的是()A、?內(nèi)容窗格直接屬于框架,是框架的重要組成部分B、?當(dāng)改變框架的大小時(shí),內(nèi)容窗格的大小也自動(dòng)改變C、?圖形界面的所有組件都放在內(nèi)容窗格上D、?內(nèi)容窗格放在分層窗格的深度為-30000的那一層,以保證它位于所有其他內(nèi)容的最下面E、?當(dāng)把組件放在框架上時(shí),Java內(nèi)部時(shí)間實(shí)際上將它放到內(nèi)容窗格上17.Which?statement?is?true?for?the?class?java.util.ArrayList?()??A、?The?elements?in?the?collection?are?ordered.B、?The?collection?is?guaranteed?to?be?immutable.C、?The?elements?in?the?collection?are?guaranteed?to?be?unique.D、?The?elements?in?the?collection?are?accessed?using?a?unique?key.E、?The?elements?in?the?collections?are?guaranteed?to?be?synchronized.18.現(xiàn)有:????? class?Pencil??{? public?void?write?(String?content){? System.out.println?("Write"+content);?????}?????}? class?RubberPencil?extends?Pencil{?????public?void?write?(String?content){? System.out.println?("Rubber?Write"+content);?????}? public?void?erase?(String?content){?????System.out.println?("Erase?"+content);?????}?????} 執(zhí)行下列代碼的結(jié)果是哪項(xiàng)?()? Pencil?pen=new?RubberPencil();????? pen.write("Hello");?????A、??Write?HelloB、??Rubber?Write?HelloC、編譯錯(cuò)誤D、運(yùn)行時(shí)拋出異常19.Given:? int[]?myArray=newint[]?{1,?2,3,4,?5};? What?allows?you?to?create?a?list?from?this?array?()?A、?List?myList?=?myArray.asList();B、?List?myList?=?Arrays.asList(myArray);C、?List?myList?=?new?ArrayList(myArray);D、?List?myList?=?Collections.fromArray(myArray);20.Which?declaration?prevents?creating?a?subclass?of?an?outer?class?()A、?Static?class?FooBar{}B、?Private?class?FooBar{}C、?Abstract?public?class?FooBar{}D、?Final?public?class?FooBar{}E、?Final?abstract?class?FooBar{}21.What?is?the?numerical?range?of?a?char?()???A、?0?...?32767B、?0?...?65535C、?–256?...?255D、?–32768?...?32767E、?Range?is?platform?dependent.22.Given:? 1.?public?class?Method?Over?{? 2.?public?void?set?Var?(int?a,?int?b,?float?c)?{? 3.?}? 4.?}?? Which?two?overload?the?set?Var?method()?A、?private?void?set?Var(int?a,?float?c,?int?b)?{}B、?protected?void?set?Var(int?a,?int?b,?float?c)?{}C、?public?int?set?Var(int?a,?float?c,?int?b)?{return?a:}D、?public?int?set?Var(int?a,?int?b,?float?c)?{return?a:}E、?protected?float?set?Var(int?a,?int?b,?float?c)?{return?c:}23.下面的說(shuō)法正確的是()A、帶有頁(yè)作用域的對(duì)象在一個(gè)web應(yīng)用程序的每個(gè)JSP中都存在B、指令指定與一個(gè)特定的JSP?請(qǐng)求不相關(guān)的全局信息。C、當(dāng)JSP容器遇到開(kāi)始定制標(biāo)簽和結(jié)束定制標(biāo)簽時(shí),分別調(diào)用doInitBody方法和doAfterBody方法。D、動(dòng)作只在翻譯時(shí)處理一次。24.Which?statements?concerning?the?value?of?a?member?variable?are?true,?when?no?explicit?assignments?have?been?made?()??A、The?value?of?an?int?is?undetermined.B、The?value?of?all?numeric?types?is?zero.C、The?compiler?may?issue?an?error?if?the?variable?is?used?before?it?is?initialized.D、The?value?of?a?String?variable?is?""?(empty?string).E、The?value?of?all?object?variables?is?null.25.HTTPS是使用()來(lái)保證信息安全的。A、SETB、IPSECC、SSLD、SSH卷II一.參考題庫(kù)(共25題)1.Which?statement?of?assigning?a?long?type?variable?to?a?hexadecimal?value?is?correct?()A、?long?number?=?345L;B、?long?number?=?0345;C、?long?number?=?0345L;D、?long?number?=?0x345L;2.對(duì)于滿足SQL92標(biāo)準(zhǔn)的SQL語(yǔ)句:? select?foo,count(foo)from?pokes?where?foo>10group?by?foo?having?count?(*)>5?order?by?foo?? 其執(zhí)行順序應(yīng)該是()。A、FROM->WHERE->GROUP?BY->HAVING->SELECT->ORDER?BYB、FROM->GROUP?BY->WHERE->HAVING->SELECT->ORDER?BYC、FROM->WHERE->GROUP?BY->HAVING->ORDER?BY->SELECTD、FROM->WHERE->ORDER?BY->GROUP?BY->HAVING->SELECT3.通過(guò)Ajax,客戶(hù)端獲取的數(shù)據(jù)主要有兩種類(lèi)型:文本型和()4.Given?an?HttpServletRequest?request: 22.String?id?=?request.getParameter("jsessionid"); 23.//?insert?code?here 24.String?name?=?(String)?session.getAttribute("name"); Which?three?can?be?placed?at?line?23?to?retrieve?anexisting?HttpSession?object?()A、HttpSession?session?=?request.getSession();B、HttpSession?session?=?request.getSession(id);C、HttpSession?session?=?request.getSession(true);D、HttpSession?session?=?request.getSession(false);E、HttpSession?session?=?request.getSession("jsessionid");5.Which?constructs?a?DataOutputStream?()??A、?New?dataInputStream(“in.txt”);B、?New?dataInputStream(new?file(“in.txt”));C、?New?dataInputStream(new?writer(“in.txt”));D、?New?dataInputStream(new?FileWriter(“in.txt”));E、?New?dataInputStream(new?InputStream(“in.txt”));F、?New?dataInputStream(new?FileInputStream(“in.txt”));6.JAVA語(yǔ)言的下面幾種數(shù)組復(fù)制方法中,哪個(gè)效率最高()。A、for循環(huán)逐一復(fù)制B、System.arraycopyC、System.copyofD、使用clone方法7.Which?HTTP?method?has?the?characteristic?that?multiple?indential?requests?may?produce?side?effect?beyond?those?of?a?single?request()?A、?PUTB、?GETC、?INFOD、?POSTE、?HEADF、?TRACE8.java中下面哪個(gè)能創(chuàng)建并啟動(dòng)線程()。 A、AB、BC、CD、D9.如何設(shè)置彈性布局的約束?()A、利用組件的setConstraints函數(shù)設(shè)置約束B(niǎo)、利用面板的setConstraints函數(shù)設(shè)置約束C、利用而已管理器的putConstraints函數(shù)設(shè)置約束D、利用SpringLayoutConstraints對(duì)象設(shè)置約束10.class?Output?{? public?static?void?main(String?[]?args)?{? int?i?=?4;? System.out.print("3"?+?i?+?"?");? System.out.print(i?+?4?+?"6");? System.out.println(i?+?"7");? }? }? 結(jié)果為()?A、7?8611B、7?44647C、34?8611D、34?864711.//point?X? public?class?foo?(? public?static?void?main?(String[]args)?throws?Exception?{? printWriter?out?=?new?PrintWriter?(new? java.io.outputStreamWriter?(System.out),?true;? out.printIn(“Hello”);? }? )?? Which?statement?at?PointX?on?line?1?allows?this?code?to?compile?and?run?()??A、?Import?java.io.PrintWriter;B、?Include?java.io.PrintWriter;C、?Import?java.io.OutputStreamWriter;D、?Include?java.io.OutputStreamWriter;E、?No?statement?is?needed.12.現(xiàn)有? class?Parser?extends?Utils?{? public?static?void?main?(String??[]??args)??{? try??{??System.out.print?(new?Parser?()?.getlnt?("42"))?????? }??catch?(Exception?e)?{? System.out.println?("Exc")?;??}????? }? int?getlnt?(String?arg)??throws?Exception??{???? return?Integer.parselnt?(arg)?;????? }????? }? class?Utils?{? int?getlnt?()??{??return?42;??}???? }? 結(jié)果是什么?()??????A、?42ExcB、?ExcC、?42D、編譯失敗13.下列有關(guān)main()方法的簽名正確的是哪些?()A、?public?static?void?main(String[]?args){}B、?public?static?void?main(){}C、?public?static?void?main(String?args[]){}D、?public?void?static?main(String[]?args){}14.String?a?=?“ABCD”;? String?b?=?a.toLowerCase();? b.replace(‘a(chǎn)’,?‘d’);? b.replace(‘b’,?‘c’);? System.out.println(b);?? What?is?the?result??()?A、?abcdB、?ABCDC、?dccdD、?dcbaE、?Compilation?fails.F、?An?exception?is?thrown?at?runtime.15.下面哪些類(lèi)可用于throw語(yǔ)句()A、ErrorB、ExceptionC、EventD、Throwable16.下面有關(guān)struts1和struts2的區(qū)別,描述錯(cuò)誤的是()。A、Struts1要求Action類(lèi)繼承一個(gè)抽象基類(lèi)。Struts?2?Action類(lèi)可以實(shí)現(xiàn)一個(gè)Action接口B、Struts1?Action對(duì)象為每一個(gè)請(qǐng)求產(chǎn)生一個(gè)實(shí)例。Struts2?Action是單例模式并且必須是線程安全的C、Struts1?Action?依賴(lài)于Servlet?API,Struts?2?Action不依賴(lài)于容器,允許Action脫離容器單獨(dú)被測(cè)試D、Struts1?整合了JSTL,Struts2可以使用JSTL,但是也支持OGNL17.What?is?the?result?() A、hi?hiB、hi?worldC、world?worldD、Compilation?fails.E、An?exception?is?thrown?at?runtime.18.Less?Test{??? public?static?void?main(String[]?args){?? for(int?x=0;x<7;++x){? int?y=2;?? x=++y;?? }?? System.out.println(“y=”+y);?? }?? }?? 結(jié)果為:()??A、y=5B、y=6C、?y=7D、y=8E、編譯失敗F、運(yùn)行時(shí)異常被拋出19.編寫(xiě)一個(gè)應(yīng)用程序,對(duì)程序中給定的四個(gè)double型數(shù)據(jù)求其最大值和最小值。20.public?class?Pass?{? public?static?void?main(String?[1?args)?{? int?x?5;? Pass?p?=?new?Pass();? p.doStuff(x);? System.out.print(”?main?x?=?“+?x);? }? void?doStuff(int?x)?{? System.out.print(”?doStuff?x?=?“+?x++);? }? }? What?is?the?result?()?A、?Compilation?fails.B、?An?exception?is?thrown?at?runtime.C、?doStuffx?=?6?main?x?=?6D、?doStuffx?=?5?main?x?=?5E、?doStuffx?=?5?main?x?=?6F、?doStuffx?=?6?main?x?=?521.編寫(xiě)一個(gè)程序,能將一個(gè)Java源程序中的空行及注釋去掉。22.A?JSP?page?needs?to?instantiate?a?JavaBean?to?be?used?by?only?that?page.?Which?two?jsp:useBean?attributes?must?be?used?to?access?this?attribute?in?the?JSP?page?()A、?idB、?typeC、?nameD、?classE、?scopeF、?create23.現(xiàn)有:? interface?Data?{public?void?load();}? abstract?class?Info?{public?abstract?void?load();}????? 下列類(lèi)定義中正確使用Data和Info的是哪項(xiàng)?()?A、?public?class?Employee?implements?Info?extends?Data?{?public?void?load(){/*dosomething*/}?????}B、public?class?Employee?extends?Inf.implements?Data{?public?void?load()?{/*do?something*/}?????}C、public?class?Empl.yee?implements?Inf?extends?Data{?public?void?Data.1oad(){*?do?something*/}?????public?void?load(){/*do?something*/}?????}D、public?class?Employee?extends?Inf?implements?Data??{??public?void?Data.1oad()??{/*do?something*/)?????public?void?info.1oad(){/*do?something*/}????}24.Given?the?following?code:???? 1)?class?Parent?{???? 2)?private?String?name;???? 3)?public?Parent(){}???? 4)?}? 5)?public?class?Child?extends?Parent?{???? 6)?private?String?department;? 7)?public?Child()?{}? 8)?public?String?getValue(){?return?name;?}???? 9)?public?static?void?main(String?arg[])?{???? 10)?Parent?p?=?new?Parent();???? 11)?}? 12)?}? Which?line?will?cause?error?()???A、?line?3B、?line?6C、?line?7D、?line?8E、?line?1025.Java語(yǔ)言中常量的定義是哪項(xiàng)?()A、?public?staticB、?public?static?finalC、?finalD、?public?static?abstract卷III一.參考題庫(kù)(共25題)1.Which?two?statements?are?reserved?words?in?Java?()?????????A、?RunB、?ImportC、?DefaultD、?Implement2.用迭代法編寫(xiě)程序用于求解立方根。3.求數(shù)列2,4,8,16,32,…前若干項(xiàng)之和。當(dāng)和大于9000時(shí),終止求和并輸出結(jié)果4.下面哪些代碼為正確的()A、B、C、D、5.How?do?objects?pass?messages?in?Java?()???A、They?pass?messages?by?modifying?each?other’s?member?variablesB、They?pass?messages?by?modifying?the?static?member?variables?of?each?other’s?classesC、They?pass?messages?by?calling?each?other’s?instance?member?methodsD、They?pass?messages?by?calling?static?member?methods?of?each?other’s?classes.6.表達(dá)式““.equals(null)的結(jié)果為x=10; 36.do{ 37.x--; 38.}while(x<10); Howmanytimeswillline37beexecuted?()A、tentimesB、zerotimesC、onetometimesD、morethantentimes8.1.?public?class?enclosingone?(? 2.?public?class?insideone{}? 3.?)? 4.?public?class?inertest(? 5.?public?static?void?main?(string[]args)(? 6.?enclosingone?eo=?new?enclosingone?();? 7.?//insert?code?here? 8.?)? 9.?)??? Which?statement?at?line?7?constructs?an?instance?of?the?inner?class?()??A、?InsideOnew?ei=?eo.new?InsideOn();B、?Eo.InsideOne?ei?=?eo.new?InsideOne();C、?InsideOne?ei?=?EnclosingOne.new?InsideOne();D、?EnclosingOne.InsideOne?ei?=?eo.new?InsideOne();9.this()表示()A、引用當(dāng)前對(duì)象B、調(diào)用當(dāng)前對(duì)象C、調(diào)用當(dāng)前對(duì)象的方法D、調(diào)用當(dāng)前對(duì)象的構(gòu)造函數(shù)10.You?want?subclasses?in?any?package?to?have?access?to?members?of?a?superclass.?Which?is?the?most?restrictive?access?that?accomplishes?this?objective?()??A、?publicB、?privateC、?protectedD、?transientE、?default?access11.Click?the?'Select?and?Place'?button. Place?the?events?in?the?order?they?occur. 12.java語(yǔ)言中,按照一定格式生成程序的文檔的工具是()。A、javacB、javahC、javadocD、jar13.現(xiàn)有:D?? -?f?是一個(gè)對(duì)?java.io.File?實(shí)例的合法引用?? -?fw?是一個(gè)對(duì)?java.io.FileWriter?實(shí)例的合法引用?? -?bw?是一個(gè)對(duì)?java.io.BufferedWriter?實(shí)例的合法引用?? 以下哪一項(xiàng)無(wú)效?()??A、?PrintWriter?prtWtr?=?new?PrintWriter(f);B、?PrintWriter?prtWtr?=?new?PrintWriter(fw);C、?PrintWriter?prtWtr?=?new?PrintWriter(bw);D、?BufferWriter?bufWtr?=?new?BufferedWriter(f);E、?BufferWriter?bufWtr?=?new?BufferedWriter(fw);F、?BufferWriter?bufWtr?=?new?BufferedWriter(bw);14.有5個(gè)人坐在一起,問(wèn)第五個(gè)人多少歲?他說(shuō)比第4個(gè)人大2歲。問(wèn)第4個(gè)人歲數(shù),他說(shuō)比第3個(gè)人大2歲。問(wèn)第三個(gè)人,又說(shuō)比第2人大兩歲。問(wèn)第2個(gè)人,說(shuō)比第一個(gè)人大兩歲。最后問(wèn)第一個(gè)人,他說(shuō)是10歲。請(qǐng)問(wèn)第五個(gè)人多大?15.現(xiàn)有:? class??Test4??{? public?static?void?main?(String??[]??args)??{??? boolean?X=true;?? boolean?y=false;??? short?Z=42;??? if((z++==42)??&&??(y=true))z++;??? if((x=false)??||????(++z==45))??z++;??? System.?out.println(¨z=”+z);??? ?}??? }? 結(jié)果為:()?A、??Z=42B、??z=44C、??Z=?45D、??z=?4616.現(xiàn)有:? class?HorseRadish??{????? //insert?code?here? protected?HorseRadish?(int?x)????{????? System.out.println?("bok?choy");????? }????? }? class?Wasabi?extends?HorseRadish??{? public?static?void?main?(String??[]??args){??? Wasabi?w-?new?Wasabi();???? }???? }? 分別插入到第2行,哪兩項(xiàng)允許代碼編譯并產(chǎn)生”bok?choy”輸出結(jié)果()A、?protected?HorseRadish()??{this?(42);}B、??protected?HorseRadish()??{}C、??//just?a?commentD、??protected??HorseRadish()??{??new?HorseRadish?(42);}17.關(guān)于以下application,說(shuō)法正確是什么()。 A、4行與9行不能通過(guò)編譯,因?yàn)槿鄙俜椒头祷仡?lèi)型B、編譯通過(guò),執(zhí)行結(jié)果是:x=5C、編譯通過(guò),執(zhí)行結(jié)果是:x=3D、9行不能通過(guò)編譯,因?yàn)橹荒苡幸粋€(gè)靜態(tài)初始化器18.java接口的方法修飾符可以為()。(忽略?xún)?nèi)部接口)A、privateB、protectedC、finalD、abstract19.12.?String?csv?=?“Sue,5,true,3”;? 13.?Scanner?scanner?=?new?Scanner(?csv);? 14.?scanner.useDelimiter(”,”);? 15.?int?age?=?scanner.nextInt();? What?is?the?result?()?A、?Compilation?fails.B、?After?line?15,?the?value?of?age?is?5.C、?After?line?15,?the?value?of?age?is?3.D、?An?exception?is?thrown?at?runtime.20.我們定義一個(gè)Account類(lèi)來(lái)描述銀行賬戶(hù),銀行賬戶(hù)有賬戶(hù)名、金額等屬性特征,同時(shí)有存款、取款等行為特征,下述代碼適合描述的是哪項(xiàng)?()?????A、class??Accountf?????

String?name;//賬戶(hù)?????S

tring?amount;??//金額?????

Account?(String?name)(????)

void?deposit?(double?mount){??//存款?????)

void?withdraw?(double?mount){??//取款?????}?????)B、class??Accountf?????

String?name;//賬戶(hù)d

ouole?amount;??//金額?????

Account(double?amount){???}

void?deposit?(double?mount){??//存款?????)

void?withdraw?(double?mount){??//取款?????)?????)C、class??Accountf?????

String?name;//賬戶(hù)

double?amount;??//金額????

?Account?(String?name){}

void?deposit?(double?mount){//存款?????)?

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論