<dfn id="w48us"></dfn><ul id="w48us"></ul>
  • <ul id="w48us"></ul>
  • <del id="w48us"></del>
    <ul id="w48us"></ul>
  • SUN國際認(rèn)證試題及答案

    時間:2024-09-20 16:27:19 SUN認(rèn)證 我要投稿
    • 相關(guān)推薦

    SUN國際認(rèn)證試題及答案

      作為一個IT工作人員,你有考過SUN認(rèn)證嗎?下面yjbys小編為大家分享最新的SUN國際認(rèn)證考試題及答案,希望對大家的學(xué)習(xí)有所幫助!

    SUN國際認(rèn)證試題及答案

      1.Which of the following fragments might cause errors?

      A. String s = "Gone with the wind";

      String t = " good ";

      String k = s + t;

      B. String s = "Gone with the wind";

      String t;

      t = s[3] + "one";

      C. String s = "Gone with the wind";

      String standard = s.toUpperCase();

      D. String s = "home directory";

      String t = s - "directory";

      answer:(BD)這道題考察java字符串和連接符+的理解,B中s[3]是一個字符,而不能和一個字符串用連接符連起來。而D則是我們初學(xué)java時以為有+必定有-,所以導(dǎo)致錯誤。java中的連接符只有一個就是+。而且字符串和字符是兩個不同的概念,我們要區(qū)分開來。

      2. Given the following code fragment:

      1) public void create() {

      2) Vector myVect;

      3) myVect = new Vector();

      4) }

      Which of the following statements are true?

      A. The declaration on line 2 does not allocate memory space for the variable myVect.

      B. The declaration on line 2 allocates memory space for a reference to a Vector object.

      C. The statement on line 2 creates an object of class Vector.

      D. The statement on line 3 creates an object of class Vector.

      E. The statement on line 3 allocates memory space for an object of class Vector

      answer:(ADE)這題考察獲得實例的內(nèi)存變化。定義一個實例并不能給對象分配內(nèi)存空間,系統(tǒng)只給定義的那個變量分配空間。只有當(dāng)new 出一個對象時系統(tǒng)回給一個實例對象分配內(nèi)存空間。

      3. Which are not Java keywords?

      A. TRUE

      B. sizeof

      C. const

      D. super

      E. void

      answer:(AB)sizeof是c++語言的的關(guān)鍵字,不是java的,我做題的時候覺得sizeof很熟悉,想當(dāng)然以為它就是java的關(guān)鍵字,結(jié)果可想而知。

      4. Which are not Java primitive(基本) types?

      A. short

      B. Boolean

      C. unit

      D. float

      answer:(BC)java基本數(shù)據(jù)類型只有8個,而Boolean是引用數(shù)據(jù)類型。選錯了,關(guān)鍵是沒弄清primitive是什么意思,汗顏啊,英語太差了。

      5. Which statements about the garbage collection are true?

      A. The program developer must create a thread to be responsible for free

      the memory.

      B. The garbage collection will check for and free memory no longer needed.

      C. The garbage collection allow the program developer to explicity and

      immediately free the memory.

      D. The garbage collection can free the memory used java object at expect

      time.

      answer:(B)java垃圾自動回收機制,我們不能讓虛擬機什么時候開始垃圾回收,垃圾回收是不受我們控制的,就算我們想要快點垃圾回收,我們只能通過一個gc()函數(shù)希望快點垃圾回收,但是程序回不回提前垃圾回收還是不知道的。所以選b。

      6、Which of the following assignment is not correct?

      A. float f = 11.1;

      B. double d = 5.3E12;

      C. double d = 3.14159;

      D. double d = 3.14D.

      answer:(A)記住基本數(shù)據(jù)類型中int和double都是默認(rèn)的,所以a是錯的,把double轉(zhuǎn)換成float型要強制類型轉(zhuǎn)換。第一次碰到這樣的題的時候我全錯,不過現(xiàn)在好了。

      7、Given the uncompleted code of a class:

      class Person {

      String name, department;

      int age;

      public Person(String n){ name = n; }

      public Person(String n, int a){ name = n; age = a; }

      public Person(String n, String d, int a) {

      // doing the same as two arguments version of constructor

      // including assignment name=n,age=a

      department = d;

      }

      }

      Which expression can be added at the "doing the same as..." part of the constructor?

      A. Person(n,a);

      B. this(Person(n,a));

      C. this(n,a);

      D. this(name,age).

      answer:(C)這題有較大迷惑,要是不認(rèn)真看,估計會選d,看看參數(shù)列表是n和a,如果選擇d的話就錯了。

      8、public void test() {

      try { oneMethod();

      System.out.println("condition 1");

      } catch (ArrayIndexOutOfBoundsException e) {

      System.out.println("condition 2");

      } catch(Exception e) {

      System.out.println("condition 3");

      } finally {

      System.out.println("finally");

      }

      }

      Which will display if oneMethod run normally?

      A. condition 1

      B. condition 2

      C. condition 3

      D. finally

      answer:(AD)finally 修飾的最終都將會運行,所以當(dāng)程序正常運行,不拋出異常時,AD都將運行。

      9 Given the following code fragment:

      1) String str = null;

      2) if ((str != null) && (str.length() > 10)) {

      3) System.out.println("more than 10");

      4) }

      5) else if ((str != null) & (str.length() < 5)) {

      6) System.out.println("less than 5");

      7) }

      8) else { System.out.println("end"); }

      Which line will cause error?

      A. line 1

      B. line 2

      C. line 5

      D. line 8

      answer:(C)&&和&的區(qū)別,&是按位與計算,&兩邊的運算都要執(zhí)行;&&是邏輯運算,當(dāng)左邊為假時,右邊可以不執(zhí)行。當(dāng)右邊執(zhí)行時,可能有 (str.length()空指針異常)。

      10、Given the following code:

      public class Person{

      static int arr[] = new int[10];

      public static void main(String a[]) {

      System.out.println(arr[1]) ;

      }

      }

      Which statement is correct?

      A. When compilation some error will occur.

      B. It is correct when compilation but will cause error when running.

      C. The output is zero.

      D. The output is null.

      answer:(C)java數(shù)組默認(rèn)初始化都為0.

    【SUN國際認(rèn)證試題及答案】相關(guān)文章:

    Sun國際認(rèn)證06-10

    Sun國際認(rèn)證考試證書查詢04-26

    2016年Sun認(rèn)證重點試題10-06

    sun認(rèn)證java基礎(chǔ)模擬試題10-26

    Sun Solaris 國際認(rèn)證考試流程表10-04

    Sun java認(rèn)證考試真題答案09-25

    Sun國際認(rèn)證 中國注冊 在京正式啟動09-19

    Indesign認(rèn)證試題及答案09-28

    IBM認(rèn)證試題及答案07-21

    sun認(rèn)證:java程序設(shè)計考試試題07-25

    主站蜘蛛池模板: 亚洲国产高清精品线久久 | 亚洲国产精品不卡毛片a在线| 久久精品人成免费| 国产99视频精品免费视频76| 亚洲精品线路一在线观看| 欧美亚洲精品在线| 午夜精品久久久久久毛片| 国产精品日韩欧美在线第3页 | 久久亚洲精品人成综合网 | 3D动漫精品一区二区三区| 久久国产综合精品五月天| 国产亚洲综合成人91精品| 亚洲精品一品区二品区三品区| 国产69精品久久久久99尤物| 97久久超碰国产精品旧版| 真实国产乱子伦精品一区二区三区| 国产精品午夜国产小视频| 国产精品亚洲片在线va| 漂亮人妻被黑人久久精品| 久久久99精品一区二区| 777国产盗摄偷窥精品0OOO| 97精品国产福利一区二区三区| 亚洲欧洲自拍拍偷精品 美利坚| 国产精品白丝AV嫩草影院| 久久99热狠狠色精品一区| 精品久久久久久久无码| 亚洲精品无码久久久| 欧美日韩国产精品| 国产一区精品| 99久久www免费人成精品| 国产精品美女久久久久网| 精品国偷自产在线| 亚洲AV日韩精品久久久久久 | 国产精品H片在线播放| 久久精品成人国产午夜| 国产精品毛片无遮挡| 久久精品国产亚洲AV大全| 欧洲成人午夜精品无码区久久| 中文字幕精品久久久久人妻| 亚洲国产成人乱码精品女人久久久不卡| 久久久WWW免费人成精品|