




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
《JAVA語言設(shè)計(jì)》試卷B《JAVA語言設(shè)計(jì)》試卷B一二三四五六A.$millionB.$_milliC.2$_millionD.$2B.若用于比較的數(shù)據(jù)類型為double型,則不可以用裝訂線6、下面是有關(guān)子類繼承父類構(gòu)造函數(shù)的描述,其中正確的是B.子類無條件地繼承父類不含參數(shù)的構(gòu)A.大小B.顏色C.名稱D.D.類外調(diào)用該方法的方式必須是:對(duì)象名.方法名(答A表示說法正確.答B(yǎng)表示說法不正確,本題只需指答A表示說法正確.答B(yǎng)表示說法不正確,本題只需指17、使用Thread子類創(chuàng)建線程的優(yōu)點(diǎn)是可以在子類中增加新的成員變20、對(duì)數(shù)據(jù)庫操作時(shí),使用PreparedStatement執(zhí)行SQL語句,比起21、把編寫好的Java源文件保存起來,源文件的裝訂線classA{A(){System.out.println(“A”);doublef(doublex,doubley){}ClassBextendsA{B(){System.out.println(“B”);doublef(doublex,doubley){}publicclassTest{}returnx*y;}}returnx+y;}publicstaticvoidmain(Stringargs[]){Aobj=newB();System.out.println("Theprogramoutputis"+obj.f(4,6));}}Connectionconn=DBTool.getConnection();try{Stringsql="selectcount(*)frommanagerwhereusername=?andpassword=?";PreparedStatementpst=conn.prepareStatement(sql);pst.setString(1,userName);pst.setString(2,password);ResultSetrs=pst.executeQuery();intcount=0;if(rs.next()){count=rs.getInt(1);}}catch(SQLExceptione){e.printStackTrace();}finally{conn.close();}TreeSet<Integer>set=newTreeSet<Integer>();set.add(2);set.add(5);set.TreeSet<Integer>set=newTreeSet<Integer>();set.add(2);set.add(5);set.add(3);set.add(8);try{ObjectOutputStreambr=newObjectOutputStream(newFileOutputStream("a.txt"));br.writeObject(set);br.close();ObjectInputStreambi=newObjectInputStream(newFileInputStream("a.txt"));TreeSet<Integer>s=(TreeSet)bi.readObject();Iterator<Integer>it=s.iterator();while(it.hasNext()){System.out.println(it.next());}bi.close();}catch(IOExceptione){System.out.println(e.getMessage());}publicclassTestException{publicvoidCreateException()throwsException{thrownewException("newexception");}publicstaticvoidmain(String[]args){TestExceptionte=newTestException();try{System.out.println("trycalledstart");te.CreateException();System.out.println("trycalledend");}catch(Exceptionex){System.out.println("catchcalled");System.out.println(ex.getMessage());}finally{System.out.println("finallycalled");}System.out.print("main()finished");}裝訂線}34.、publicvoidrun(){DatagramPacketpack=null;DatagramSocketmail_data=null;bytedata[]=newbyte[8192];try{pack=newDatagramPacket(data,data.length);mail_data=newDatagramSocket(888);while(true){mail_data.receive(pack);Stringmessage=newString(pack.getData(),0,pack.getLength());System.out.println("收到數(shù)據(jù)是:"+message+"\n");}}catch(Exceptione){System.out.println(e.getMessage());}}啟動(dòng)源代碼如下:privateStringbland;privateStringtype;publicabstractvoidstart();public【②】(Stringbland,Stringtype){this.bland=bland;this.type=type;}publicStringtoString(){return"品牌:"+bland+";型號(hào):"+type;}}publicclassBMW【③】Car{publicBMW(Stringbland,Stringtype){【④】(bland,type);publicBMW(Stringbland,Stringtype){【④】(bland,type);}publicvoidstart(){System.out.println("啟動(dòng)");}publicstaticvoidmain(Stringargs[]){Carcar=new【⑤】("寶馬","X5");System.out.println(car.toString());car.start();}}序,在⑥~⑩處補(bǔ)充相應(yīng)的內(nèi)容,使整個(gè)程序能夠正publicclassJ_Test{privateJFramef;privateJButtonbutton1,button2,button3;publicvoidgo(){f=【⑥】JFrame("Test");f.setLayout(newFlowLayout());button1=newJButton("Ok");button2=newJButton("Open");button3=newJButton("Close");f.add(button1);f.add(button2);f.add(button3);f.setSize(160,106);f.setVisible(【⑧】);}publicstaticvoidmain(String[]args){J_Testt=newJ_Test();t.go();}}ClassMonitor【⑨】ActionListener{publicvoid【⑩】(ActionEvente){System.exit(0);}}①②③④
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年海水淡化及水處理設(shè)備項(xiàng)目建議書
- 基地參觀報(bào)告范文
- 2025年高阻隔性封裝材料項(xiàng)目申請(qǐng)報(bào)告
- 機(jī)床整改報(bào)告范文及范文
- 2025年超低頻振動(dòng)標(biāo)準(zhǔn)項(xiàng)目申請(qǐng)報(bào)告模范
- 第8課 三國至隋唐的文化 教學(xué)設(shè)計(jì)-2023-2024學(xué)年統(tǒng)編版(2019)高中歷史必修中外歷史綱要上冊(cè)
- 思政元素融入小學(xué)數(shù)學(xué)“數(shù)與代數(shù)”領(lǐng)域的教學(xué)策略探究
- 初中生物實(shí)驗(yàn)教學(xué)現(xiàn)狀與優(yōu)化研究
- 2024沈陽盛京金控投資集團(tuán)有限公司招聘筆試參考題庫附帶答案詳解
- 2024廣西憑祥市友誼關(guān)旅游開發(fā)有限公司招聘11人筆試參考題庫附帶答案詳解
- 《城市軌道交通應(yīng)急處理》課件-《城市軌道交通應(yīng)急處理》項(xiàng)目四
- 臨建工程勞務(wù)承包條件
- 2024年山東省青島市中考道德與法治試題卷(含答案及解析)
- GB/T 44561-2024石油天然氣工業(yè)常規(guī)陸上接收站液化天然氣裝卸臂的設(shè)計(jì)與測試
- 員工履歷表(標(biāo)準(zhǔn)樣本)
- 薪酬管理制度、員工薪資結(jié)構(gòu)規(guī)定、薪酬福利管理制度
- 2024-2030年中國實(shí)驗(yàn)室自動(dòng)行業(yè)市場發(fā)展分析及投資發(fā)展戰(zhàn)略研究報(bào)告
- 睪丸扭轉(zhuǎn)的護(hù)理課件
- 小兒(兒童)常見皮疹理論考核試題
- 北京市《配電室安全管理規(guī)范》(DB11T 527-2021)地方標(biāo)準(zhǔn)
- 北師大版(三起)(2024)三年級(jí)上冊(cè)英語Unit 1 Family單元測試卷(含答案)
評(píng)論
0/150
提交評(píng)論