下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、。裝。訂。線。2008 年2009 年第一學(xué)期Java 高級編程期末試題A 卷時(shí)間共 120 分鐘說明:盡量用英文答題,用中文答題酌情扣分一、單項(xiàng)選擇題(每題 2 分,共 30 分)1. Which declaration for the maA public main(String args)ethod is valid ()B public s ic void main(String args) C private s ic void main(String args) D void main()Which line is wrong for the below codes (String
2、 str = null;if (str != null) & (str.length() 10) )3) System.out.pr4) ln(moren 10);5) else if (str != null) & (str.length() 0 ) 5) j = I * 2;6) System.out.pr 7) k = k + 1;8) I-;9) 10) ln ( The value of j is + j );Then which line will be wrong when running the codes? ()A line 4B line 6C line 7D line 8
3、9. The variable MAX_LENGTH, which value is constant 100, will be declared asand public, thenwe should do ()A publicMAX_LENGTH=100;B finalMAX_LENGTH=100;C final public D public finalMAX_LENGTH=100; MAX_LENGTH=100.There are codes as follows:public class Test 2)m, n;3) public Test() 4) public Test(a) m
4、=a; public sTest t1,t2;ic void main(String arg) 7)j,k;8) j=0; k=0;t1=new Test();t2=new Test(j,k);11) 12) Then, when compiling the codes, which line will appear errors ()A line 3B line 5C line 6D line 1011. When throwing an exception, which keyword should be used ()A transientB finallyC throw)C java.
5、awtD sic12. The class System belongs to (A java.utilB java.ioD java.lang)Which declaration about Applet is right (There needs main() in Applet programsApplet classes must inherit java.awt.AppletC. Applet can acs local filesD. Applet programs do not need to compile14. There are codes as follows: publ
6、ic class testsica = new a10;public sic void main(String args) System.out.prln(arr10);Then which is right ()There will be errors when compilingIt is right when compiling, but there will be errors when runningThe output is 0The output is null15. To read 10 bytes from the file file.dat andthem to varia
7、ble c, then we should do ()A FileInputStream in=new FileInputStream(file.dat); in.skip(9); B FileInputStream in=new FileInputStream(file.dat); in.skip(10);c=in.read();c=in.read();C FileInputStream in=new FileInputStream(file.dat);c=in.read();D RandomAcsFile in=new RandomAcsFile(file.dat); in.skip(9)
8、;c=in.readByte();二、填空題(每題 1.5 分,共 30 分)1. The entry poof Threads is 2. Creating an object of class X and naming the objex1, Please write the sement:3. There are two important types of sockets:and 4. Running the two following sements, what are the results: String s=我喜歡學(xué)習(xí) Java!;System.out.prln(s.lengt
9、h();5. Compiling Java source files with the compiler produ with the suffixfiles6. Java I/O streamse two types: byte streams and character streams. FileInputStream belongs tobyte stream, BufferedWriter belongs to 7. If a class in a java program is declared as, the program name should be same asthe cl
10、aame.8. Please write out the results of the below program:public class Test extends TT public void main(String args) Test t = new Test(Tom);public Test(String s) super(s);System.out.prpublic Test()ln(How do you do?);this(I am Tom);class TT public TT()System.out.prln(What a pleasure!);public TT(Strin
11、g s) this();System.out.prln(I am +s);9. Filling appropriate information import java.awt.*;import java.applet.Applet;he bls.public classoJavaApplet extends /there define an applet class得分閱卷人public void pa(Graphics g)Font f=new Font(黑體,Font.BOLD,48);/在 Applet 程序中顯示的內(nèi)容字體設(shè)為 fg.drawString(o World!,55,55)
12、;10. There is an java source file as follows:public calss aaaclass bbbpublic sic void main( String args)Then, the file should be named as , theds of compiling it areAnd theds of running it are 11. Filling appropriate informationhe bls.publlic class x, y;Myclass (i, ) / Constructor(構(gòu)造器)x=i;y=j;12. Ja
13、va program has two types: and 三、簡答題(共 25 分)1. What are method overloading and method overriding? Please give examples to describe them. (10 分)2. (6 分)得分閱卷人public classTypepublic sic void main(String args ) byte x1=0 x55;byte x2=0 x552; short x3=0 x1234; short x4=0 x12345;x5=0 x123456789;System.out.prln(x5);Then after compiling above program, what e
溫馨提示
- 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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年銷售人員入職培訓(xùn)與職業(yè)發(fā)展合同
- 公開課《土地的誓言》課件
- 區(qū)塊鏈在體育領(lǐng)域的應(yīng)用案例考核試卷
- 2025版學(xué)校浴室熱水供應(yīng)設(shè)備采購與安裝合同3篇
- 2025版土地使用權(quán)出讓居間合同(高端定制版)3篇
- 2025年博主合作廣告合同
- 2025年度健康養(yǎng)生門面店鋪轉(zhuǎn)讓及服務(wù)項(xiàng)目合作協(xié)議4篇
- 2025年博物文化貸款合同
- 2025年高校外國文教專家教學(xué)與研究合作合同3篇
- 2025年公司增資協(xié)議書模板
- 乳腺癌的綜合治療及進(jìn)展
- 【大學(xué)課件】基于BGP協(xié)議的IP黑名單分發(fā)系統(tǒng)
- 2025年八省聯(lián)考高考語文試題真題解讀及答案詳解課件
- 信息安全意識培訓(xùn)課件
- 2024年山東省泰安市初中學(xué)業(yè)水平生物試題含答案
- 美的MBS精益管理體系
- 2024安全員知識考試題(全優(yōu))
- 中國移動各省公司組織架構(gòu)
- 昆明手繪版旅游攻略
- 法律訴訟及咨詢服務(wù) 投標(biāo)方案(技術(shù)標(biāo))
- 格式塔心理咨詢理論與實(shí)踐
評論
0/150
提交評論