在线现看午夜福利片|女人16久久免费视频|鲁丝片一区鲁丝片二区鲁丝|一区二区三区欧美在线

  1. 
    
    <b id="glvx9"></b>
        1. <blockquote id="glvx9"><meter id="glvx9"></meter></blockquote>
            首頁 考試吧論壇 Exam8視線 考試商城 網(wǎng)絡課程 模擬考試 考友錄 實用文檔 求職招聘 論文下載
            2011中考 | 2011高考 | 2012考研 | 考研培訓 | 在職研 | 自學考試 | 成人高考 | 法律碩士 | MBA考試
            MPA考試 | 中科院
            四六級 | 職稱英語 | 商務英語 | 公共英語 | 托福 | 雅思 | 專四專八 | 口譯筆譯 | 博思 | GRE GMAT
            新概念英語 | 成人英語三級 | 申碩英語 | 攻碩英語 | 職稱日語 | 日語學習 | 法語 | 德語 | 韓語
            計算機等級考試 | 軟件水平考試 | 職稱計算機 | 微軟認證 | 思科認證 | Oracle認證 | Linux認證
            華為認證 | Java認證
            公務員 | 報關員 | 銀行從業(yè)資格 | 證券從業(yè)資格 | 期貨從業(yè)資格 | 司法考試 | 法律顧問 | 導游資格
            報檢員 | 教師資格 | 社會工作者 | 外銷員 | 國際商務師 | 跟單員 | 單證員 | 物流師 | 價格鑒證師
            人力資源 | 管理咨詢師考試 | 秘書資格 | 心理咨詢師考試 | 出版專業(yè)資格 | 廣告師職業(yè)水平
            駕駛員 | 網(wǎng)絡編輯
            衛(wèi)生資格 | 執(zhí)業(yè)醫(yī)師 | 執(zhí)業(yè)藥師 | 執(zhí)業(yè)護士
            會計從業(yè)資格考試會計證) | 經濟師 | 會計職稱 | 注冊會計師 | 審計師 | 注冊稅務師
            注冊資產評估師 | 高級會計師 | ACCA | 統(tǒng)計師 | 精算師 | 理財規(guī)劃師 | 國際內審師
            一級建造師 | 二級建造師 | 造價工程師 | 造價員 | 咨詢工程師 | 監(jiān)理工程師 | 安全工程師
            質量工程師 | 物業(yè)管理師 | 招標師 | 結構工程師 | 建筑師 | 房地產估價師 | 土地估價師 | 巖土師
            設備監(jiān)理師 | 房地產經紀人 | 投資項目管理師 | 土地登記代理人 | 環(huán)境影響評價師 | 環(huán)保工程師
            城市規(guī)劃師 | 公路監(jiān)理師 | 公路造價師 | 安全評價師 | 電氣工程師 | 注冊測繪師 | 注冊計量師
            繽紛校園 | 實用文檔 | 英語學習 | 作文大全 | 求職招聘 | 論文下載 | 訪談 | 游戲
            您現(xiàn)在的位置: 考試吧(Exam8.com) > 軟件水平考試 > 模擬試題 > 程序員 > 正文

            全國軟考程序員考試部分例題

               例題1:

               Choose the three valid identifiers from those listed below.

               A. IDoLikeTheLongNameClass

               B. $byte

               C. const

               D. _ok

               E. 3_case

               解答:A, B, D

               點評:Java中的標示符必須是字母、美元符($)或下劃線(_)開頭。關鍵字與保留字不能作為標示符。選項C中的const是Java的保留字,所以不能作標示符。選項E中的3_case以數(shù)字開頭,違反了Java的規(guī)則。 

               例題2:

               How can you force garbage collection of an object?

               A. Garbage collection cannot be forced

               B. Call System.gc().

               C. Call System.gc(), passing in a reference to the object to be garbage collected.

               D. Call Runtime.gc().

               E. Set all references to the object to new values(null, for example).

               解答:A

               點評:在Java中垃圾收集是不能被強迫立即執(zhí)行的。調用System.gc()或Runtime.gc()靜態(tài)方法不能保證垃圾收集器的立即執(zhí)行,因為,也許存在著更高優(yōu)先級的線程。所以選項B、D不正確。選項C的錯誤在于,System.gc()方法是不接受參數(shù)的。選項E中的方法可以使對象在下次垃圾收集器運行時被收集。 

               例題3:

               Consider the following class:

               1. class Test(int i) {

               2. void test(int i) {

               3. System.out.println(“I am an int.”);

               4. }

               5. void test(String s) {

               6. System.out.println(“I am a string.”);

               7. }

               8.

               9. public static void main(String args[]) {

               10. Test t=new Test();

               11. char ch=“y”;

               12. t.test(ch);

               13. }

               14. }

               Which of the statements below is true?(Choose one.)

               A. Line 5 will not compile, because void methods cannot be overridden.

               B. Line 12 will not compile, because there is no version of test() that rakes a char argument.

               C. The code will compile but will throw an exception at line 12.

               D. The code will compile and produce the following output: I am an int.

               E. The code will compile and produce the following output: I am a String.

               解答:D 
               

               點評:在第12行,16位長的char型變量ch在編譯時會自動轉化為一個32位長的int型,并在運行時傳給void test(int i)方法。 

               例題4:

               Which of the following lines of code will compile without error?

               A. int i=0;

               if (i) {

               System.out.println(“

               Hi”);

               }

               

               B.

               boolean b=true;

               boolean b2=true;

               if(b==b2) {

               System.out.println(“So true”);

               

               }

               C.

               int i=1;

               int j=2;

               if(i==1|| j==2)

               System.out.println(“OK”);

               

               D.

               int i=1;

               int j=2;

               if (i==1 &| j==2)

               System.out.println(“OK”);

               解答:B, C

               

               點評:選項A錯,因為if語句后需要一個boolean類型的表達式。邏輯操作有^、&、| 和 &&、||,但是“&|”是非法的,所以選項D不正確。 


               例題5: 
               
               Which two demonstrate a "has a" relationship? (Choose two)

               A. public interface Person { }

               public class Employee extends Person{ }

               

               B. public interface Shape { }

               public interface Rectandle extends Shape { }

               C. public interface Colorable { }

               public class Shape implements Colorable

               

               { }

               D. public class Species{ }

               public class Animal{private Species species;}

               E. interface Component{ }

               class Container implements Component{

               private Component[] children;

               

               }

               解答:D, E

               點評: 在Java中代碼重用有兩種可能的方式,即組合(“has a”關系)和繼承(“is a”關系)!癶as a”關系是通過定義類的屬性的方式實現(xiàn)的;而“is a”關系是通過類繼承實現(xiàn)的。本例中選項A、B、C體現(xiàn)了“is a”關系;選項D、E體現(xiàn)了“has a”關系。 

            1 2 3 下一頁
            文章責編:admin  
            看了本文的網(wǎng)友還看了
            文章搜索
            軟件水平考試欄目導航
            版權聲明:如果軟件水平考試網(wǎng)所轉載內容不慎侵犯了您的權益,請與我們聯(lián)系800@exam8.com,我們將會及時處理。如轉載本軟件水平考試網(wǎng)內容,請注明出處。