(25)StringBuffer類(lèi)字符串對(duì)象的長(zhǎng)度是()
A 固定 B 必須小于16個(gè)字符
C 可變 D必須大于16個(gè)字符
(26)閱讀下面程序
Import java.io.*;
Public class WriteFile{
Public static void main (String[] A){
Int[] myArray={10,20,30,40};
Try{
FileOutputStream f=new FileOutputStream(“ints.dat”);
DataOutputStream______=new DataOutputStream(f);
For(int i=0;i Dos.writeInt(myArray[i]); Dos.close(); System.out.println(“Hava written binary file ints.dat”); } Catch(IOException ioe) { System.out.println(“IOException”); } } } 在程序下面畫(huà)線(xiàn)處填入正確選項(xiàng)是()。 A.myArray B.dos C.ioe D.ints (27)閱讀下面程序 Public classs Test2_______{ Public static void main (String[] args){ Thread t=new Test2(); t.start(); } Public void run() { System.out.println(“How are you”); } } 在程序的下畫(huà)線(xiàn)處填入的正確選項(xiàng)是()。 A.implements Thread B.extends Runnable C.implements Runnable D.extends Thread (28) 閱讀下面程序 Public class Test implements Runnable{ Public static void main(String[] args){ ________; t.start(); } Public void run() { System.out.println(“Hello!”); } } 在程序的下畫(huà)線(xiàn)處填入的正確選項(xiàng)是()。 A.Test t=new Test(); B.Thread t=new Thread(); C Thread t=new Thread (new Test()); D.Test t=new Thread(); (29) 下列關(guān)于Applet中加載圖像的說(shuō)法,錯(cuò)誤的是()。 A.可以使用Applet類(lèi)得getImage()方法獲得圖像對(duì)象 B.程序員必須自行定義獲得圖像及顯示圖像的類(lèi)與方法 C.圖像由一個(gè)Image類(lèi)得對(duì)象來(lái)表示 D.可以使用Graphics類(lèi)得drawImage()方法顯示圖像 (31) RandomAccessFile是java.io包中的一個(gè)兼有輸入輸出功能的類(lèi),由于它是隨即訪問(wèn),所以文件讀寫(xiě)一個(gè)記錄的位置是()。 A.起始 B.終止 C.任意 D.固定 (32)閱讀下面Applet程序 Import javax.swing.*; Import java.awt.*; Public class SwingApplet extends JApplet{ JLabel l=new JLabel(“This is a Swing Applet.”); Public void init(){ ____________________________________ } } 在程序的下畫(huà)線(xiàn)處填入的正確選項(xiàng)是()。 A. Container contentPane=getContentPane();contentPane.add(l); B. JPanel contentPane=new JPanel();contentPane.add(l); C. contentPane.add(l); D. add(l); (33)在java語(yǔ)言中,目錄被看做是()。 A.文件 B.流 C.數(shù)據(jù) D.接口 (34)閱讀下列實(shí)現(xiàn)堆棧并發(fā)控制的部分程序 Public class DateStack{ Private int idx=0; Private int[] data=new int[8]’ Public void push (int i){ _________________________{ Data[idx]=I; Idx++; } } … } 在下畫(huà)線(xiàn)處填入正確選項(xiàng)是()。 A.synchronized B.synchronized(this) C.synchronized() D.synchronized(idx) (35)下列關(guān)于對(duì)象串行化的說(shuō)法,錯(cuò)誤的是()。 A.Java語(yǔ)言中,默認(rèn)所有類(lèi)得對(duì)象都可串行化 B.在對(duì)象串行化時(shí),不保存對(duì)象所屬類(lèi)得構(gòu)造方法 C.在實(shí)現(xiàn)Serializable接口的類(lèi)中,用transient關(guān)鍵字可使某些數(shù)據(jù)不被串行化 D.ObjectInputStream和ObjectOutputStream類(lèi)都至此對(duì)象的讀和寫(xiě) 選擇題答案 (11)B(13)A(14)D(15)A(16)C(17)D18)A19)A(20)A(21)B(22)D(23)D(24)B(25)C(26)B(27)D (28)C(29)B(31)C(32)A33)A(34)B(35)D
2015職稱(chēng)計(jì)算機(jī)考試書(shū)PowerPoint2007中 .. 定價(jià):¥45 優(yōu)惠價(jià):¥42 更多書(shū)籍 | |
2015年全國(guó)職稱(chēng)計(jì)算機(jī)考試教材(2007模 .. 定價(jià):¥225 優(yōu)惠價(jià):¥213 更多書(shū)籍 |