




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Java面向?qū)ο蟪绦蛟O(shè)計試題一答案一、單項選擇題:選擇第1題:B選擇第2題:A選擇第3題:C選擇第4題:B選擇第5題:A選擇第6題:A選擇第7題:B選擇第8題:C選擇第9題:B選擇第10題:B二、多項選擇題多項選擇第1題:AB多項選擇第2題:BD多項選擇第3題:AD多項選擇第4題:AD多項選擇第5題:BCD多項選擇第6題:AB多項選擇第7題:ABCD多項選擇第8題:ABCD多項選擇第9題:BC多項選擇第10題:BC三、 填空題答案 填空第1題:x=10,a=3,b=4,c=5填空第2題:java.util填空第3題:(public (static (void(main(String args填
2、空第4題:1填空第5題:26 四、 編程題答案1public class HelloWorldpublic static void main(String argspublic class HelloWorld extends AppletString s;public void init(s="Hello World!"public void paint(Graphics gg.drawString(s,25,25;2class yanghuipublic static void main (String argsint i,j;int yhlevel=10;int ya
3、nghui;yanghui=new intyhlevel;for(i=0;i yanghuii=new inti+1;yanghui00=1;for (i=1; i yanghuii0=1;for(j=1;j yanghuiij=yanghuii-1j-1+yanghuii-1j;yanghuiiyanghuii.length-1=1;for (i=0; i for(j=0;j 輸出結(jié)果是:楊暉三角形:1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56
4、28 8 1 1 9 36 84 126 126 84 36 9 13public class MemoControllerFileOutputStream fos;OutputStreamWriter osw;BufferedWriter bw;public MemoController(tryfos=new FileOutputStream("memo.txt",true; osw=new OutputStreamWriter(fos;bw=new BufferedWriter(osw;catch(FileNotFoundException e;public synch
5、ronized void append(String strybw.write(s,0,s.length(; bw.flush(;bw.close(;osw.close(;fos.close(;catch(IOException epublic static void main(String argsMemoController mmc=new MemoController(;mmc.append("I am xubin "4class Phones static FileOutputStream fos;public static final int lineLength
6、 = 81;public static void main(String args throws IOExceptionbyte phone = new bytelineLength;byte name = new bytelineLength;int I;try fos = new FileOutputStream("phone.numbers"catch(FileNotFoundException e while (truereadLine(name;if ("done".equalsIgnoreCase(new String(name,0,0,4b
7、reak; readLine(phone;for (int i=0;phonei!= 0;i+ fos.write(phonei;fos.write(','for (int i=0;namei!= 0;i+fos.write(namei; fos.write('n'fos.close(; private static void readLine(byte line throws IOException int i=0,b=0; while (i linei+ = (byteb; linei=(byte 0; 5、class ThreeTimeThread extends Threadpublic ThreeTimeThread(String str super(str;public void run( while (true Date currentTime = new Date(;try sleep(1000;catch (Exception e String dateString = formatter.format(currentTime; public static void main(String args throws Exceptionnew ThreeTimeT
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 幼兒園幼小銜接教學計劃
- 多元化班級評價體系建設(shè)計劃
- 輪訓模式下的藝術(shù)教師發(fā)展計劃
- 共享服務(wù)模式下的會計管理計劃
- 高效會議管理的總結(jié)與方法計劃
- 打造水務(wù)行業(yè)的智能未來計劃
- 彩鈴呼叫流程
- 《長方體正方體的認識》(教學設(shè)計)-2023-2024學年五年級上冊數(shù)學西師大版
- 殘疾人托養(yǎng)服務(wù)投標方案(技術(shù)方案)
- 《猴子的煩惱》教學設(shè)計-2024-2025學年三年級下冊數(shù)學北師大版
- 2025年遼寧省盤錦市大洼區(qū)招聘招商人員30人高頻重點模擬試卷提升(共500題附帶答案詳解)
- 2025年安徽糧食工程職業(yè)學院單招綜合素質(zhì)考試題庫完整
- 常見意外傷害的處理課件
- 第八章運動和力單元試卷 (含答案) 2024-2025學年人教版物理八年級下
- 2025年中央一號文件高頻重點考試題庫150題(含答案解析)
- 風電項目電網(wǎng)接入系統(tǒng)可行性研究報告編制服務(wù)方案投標文件(技術(shù)方案)
- 2024人教版新教材初中地理七年級下冊內(nèi)容解讀課件(深度)
- 2025年遼寧醫(yī)藥職業(yè)學院高職單招職業(yè)適應(yīng)性測試近5年??及鎱⒖碱}庫含答案解析
- 2023-2028年中國油畫行業(yè)市場發(fā)展現(xiàn)狀及投資規(guī)劃建議報告
- 100以內(nèi)加減法練習100題(50套)-可直接打印
- 2024年09月2024興業(yè)銀行總行崗測評筆試歷年參考題庫附帶答案詳解
評論
0/150
提交評論