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

    時(shí)間:2024-09-10 09:12:43 SUN認(rèn)證 我要投稿
    • 相關(guān)推薦

    sun公司國(guó)際認(rèn)證試題及答案

      SUN認(rèn)證是給網(wǎng)絡(luò)設(shè)計(jì)界建立的一套認(rèn)證標(biāo)準(zhǔn),Sun公司推出了Java以及Solaris技術(shù)認(rèn)證方案。下面為幫助大家提高對(duì)SUN認(rèn)證的認(rèn)識(shí),yjbys小編為大家整理最新的sun公司國(guó)際認(rèn)證試題及答案,希望能幫助到大家!

    sun公司國(guó)際認(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]是一個(gè)字符,而不能和一個(gè)字符串用連接符連起來(lái)。而D則是我們初學(xué)java時(shí)以為有+必定有-,所以導(dǎo)致錯(cuò)誤。java中的連接符只有一個(gè)就是+。而且字符串和字符是兩個(gè)不同的概念,我們要區(qū)分開(kāi)來(lái)。

      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)這題考察獲得實(shí)例的內(nèi)存變化。定義一個(gè)實(shí)例并不能給對(duì)象分配內(nèi)存空間,系統(tǒng)只給定義的那個(gè)變量分配空間。只有當(dāng)new 出一個(gè)對(duì)象時(shí)系統(tǒng)回給一個(gè)實(shí)例對(duì)象分配內(nèi)存空間。

      3. Which are not Java keywords?

      A. TRUE

      B. sizeof

      C. const

      D. super

      E. void

      answer:(AB)sizeof是c++語(yǔ)言的的關(guān)鍵字,不是java的,我做題的時(shí)候覺(jué)得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個(gè),而B(niǎo)oolean是引用數(shù)據(jù)類型。選錯(cuò)了,關(guān)鍵是沒(méi)弄清primitive是什么意思,汗顏啊,英語(yǔ)太差了。

      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垃圾自動(dòng)回收機(jī)制,我們不能讓虛擬機(jī)什么時(shí)候開(kāi)始垃圾回收,垃圾回收是不受我們控制的,就算我們想要快點(diǎn)垃圾回收,我們只能通過(guò)一個(gè)gc()函數(shù)希望快點(diǎn)垃圾回收,但是程序回不回提前垃圾回收還是不知道的。所以選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是錯(cuò)的,把double轉(zhuǎn)換成float型要強(qiáng)制類型轉(zhuǎn)換。第一次碰到這樣的題的時(shí)候我全錯(cuò),不過(guò)現(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)真看,估計(jì)會(huì)選d,看看參數(shù)列表是n和a,如果選擇d的話就錯(cuò)了。

      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 修飾的最終都將會(huì)運(yùn)行,所以當(dāng)程序正常運(yùn)行,不拋出異常時(shí),AD都將運(yùn)行。

      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ū)別,&是按位與計(jì)算,&兩邊的運(yùn)算都要執(zhí)行;&&是邏輯運(yùn)算,當(dāng)左邊為假時(shí),右邊可以不執(zhí)行。當(dāng)右邊執(zhí)行時(shí),可能有 (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.

      11、Given the following code:

      public class Person{

      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:(A)這道題看起來(lái)跟前一個(gè)題一樣,但是仔細(xì)看的話這次的數(shù)組沒(méi)有聲明為static,所以靜態(tài)main方法不能直接調(diào)用,所以編譯時(shí)會(huì)有錯(cuò)誤。

      12、Which fragments are correct in Java source file?

      A. package testpackage;

      public class Test{//do something...}

      B. import java.io.*;

      package testpackage;

      public class Test{// do something...}

      C. import java.io.*;

      class Person{// do something...}

      public class Test{// do something...}

      D. import java.io.*;

      import java.awt.*;

      public class Test{// do something...}

      answer:(ACD)關(guān)于包的引用等。包必須在impotr的前面,既是包在最上面。可以沒(méi)有包的聲明。

      13:String s= "hello";

      String t = "hello";

      char c[] = {´h´,´e´,´l´,´l´,´o´} ;

      Which return true?

      A. s.equals(t);

      B. t.equals(c);

      C. s==t;

      D. t.equals(new String("hello"));

      E. t==c.

      answer:(ACD)這是String,s和t沒(méi)有new 所以只是聲明了兩個(gè)變量,ACD都正確。

      14、public class Parent {

      public int addValue( int a, int b) {

      int s;

      s = a+b;

      return s;

      }

      }

      class Child extends Parent {

      }

      Which methods can be added into class Child?

      A. int addValue( int a, int b ){// do something...}

      B. public void addValue (){// do something...}

      C. public int addValue( int a ){// do something...}

      D. public int addValue( int a, int b )throws MyException {//do something...}

      answer:(BC)涉及到方法的重寫和覆蓋,三同一不低,A是默認(rèn)的,但是父類是public的,不滿足不低的原則。看題要仔細(xì)。

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

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

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

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

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

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

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

    Sun國(guó)際認(rèn)證 中國(guó)注冊(cè) 在京正式啟動(dòng)09-19

    IBM公司認(rèn)證試題題庫(kù)(附答案)09-20

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

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

    主站蜘蛛池模板: 99久久久国产精品免费无卡顿| 91久久精品国产91性色也| 日韩精品免费在线视频| 亚洲精品亚洲人成在线观看| 国产久爱免费精品视频| freesexvideos精品老师毛多| 一级做a爰黑人又硬又粗免费看51社区国产精品视 | 欧美精品1区2区| 精品国产福利一区二区| 亚洲国产精品成人久久| 亚洲&#228;v永久无码精品天堂久久| 99RE8这里有精品热视频| 欧美极品欧美精品欧美视频| 国产成人精品免费视频大全麻豆| 免费精品无码AV片在线观看| 亚洲精品国产福利一二区| 免费视频精品一区二区| 精品无码综合一区| 久久精品国产99国产精品| 国产一在线精品一区在线观看 | 国内精品久久久久久久97牛牛| 日韩精品无码永久免费网站| 国产亚洲精品看片在线观看| mm1313亚洲国产精品无码试看| 99久久婷婷免费国产综合精品| 久久国产精品99国产精| 少妇人妻无码精品视频| 日韩精品专区AV无码| 中国国产精品| 亚洲人成精品久久久久| 亚洲人午夜射精精品日韩| 在线涩涩免费观看国产精品| 亚洲精品国产高清不卡在线| 日韩精品一区二区三区在线观看| 久久精品成人免费国产片小草| 国产激情精品一区二区三区| 国产精品第一区第27页| 精品露脸国产偷人在视频| 久久精品无码一区二区日韩AV| 精品国产欧美一区二区三区成人| 国产精品户外野外|