亚洲一级电影在线观看,九九精品无码专区免费,亚洲AV无码资源在线观看 ,欧美国产高清

sun公司國際認證試題及答案

時間:2024-09-10 09:12:43 SUN認證 我要投稿
  • 相關推薦

sun公司國際認證試題及答案

  SUN認證是給網絡設計界建立的一套認證標準,Sun公司推出了Java以及Solaris技術認證方案。下面為幫助大家提高對SUN認證的認識,yjbys小編為大家整理最新的sun公司國際認證試題及答案,希望能幫助到大家!

sun公司國際認證試題及答案

  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則是我們初學java時以為有+必定有-,所以導致錯誤。java中的連接符只有一個就是+。而且字符串和字符是兩個不同的概念,我們要區分開來。

  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)這題考察獲得實例的內存變化。定義一個實例并不能給對象分配內存空間,系統只給定義的那個變量分配空間。只有當new 出一個對象時系統回給一個實例對象分配內存空間。

  3. Which are not Java keywords?

  A. TRUE

  B. sizeof

  C. const

  D. super

  E. void

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

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

  A. short

  B. Boolean

  C. unit

  D. float

  answer:(BC)java基本數據類型只有8個,而Boolean是引用數據類型。選錯了,關鍵是沒弄清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()函數希望快點垃圾回收,但是程序回不回提前垃圾回收還是不知道的。所以選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)記住基本數據類型中int和double都是默認的,所以a是錯的,把double轉換成float型要強制類型轉換。第一次碰到這樣的題的時候我全錯,不過現在好了。

  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)這題有較大迷惑,要是不認真看,估計會選d,看看參數列表是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 修飾的最終都將會運行,所以當程序正常運行,不拋出異常時,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)&&和&的區別,&是按位與計算,&兩邊的運算都要執行;&&是邏輯運算,當左邊為假時,右邊可以不執行。當右邊執行時,可能有 (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數組默認初始化都為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)這道題看起來跟前一個題一樣,但是仔細看的話這次的數組沒有聲明為static,所以靜態main方法不能直接調用,所以編譯時會有錯誤。

  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)關于包的引用等。包必須在impotr的前面,既是包在最上面。可以沒有包的聲明。

  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沒有new 所以只是聲明了兩個變量,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是默認的,但是父類是public的,不滿足不低的原則。看題要仔細。

【sun公司國際認證試題及答案】相關文章:

Sun國際認證06-10

Sun國際認證考試證書查詢04-26

2016年Sun認證重點試題10-06

sun認證java基礎模擬試題10-26

Sun Solaris 國際認證考試流程表10-04

Sun java認證考試真題答案09-25

Sun國際認證 中國注冊 在京正式啟動09-19

IBM公司認證試題題庫(附答案)09-20

Indesign認證試題及答案09-28

IBM認證試題及答案07-21

主站蜘蛛池模板: 大又大又粗又硬又爽少妇毛片| 夜夜爽一区二区三区精品| 国语自产视频在线| 黑色丝袜脚交视频麻豆| 狠狠躁天天躁无码中文字幕 | 亚洲永久无码7777kkk| 欧美最猛黑A片黑人猛交蜜桃视频| 蜜臀AⅤ永久无码精品| 欧美精品不卡| 精品乱码一区二区三四五区| 国产精品网红尤物福利在线观看| 中文字幕v亚洲ⅴv天堂| 亚洲国产品综合人成综合网站| 亚洲色图在线观看| www插插插无码免费视频网站| 日韩做a爰片久久毛片a片 | 熟女人妻在线视频| 男人av无码天堂| 亚洲欧洲日本在线| 亚洲国产成人丁香五月激情| 欧美黑人又粗又大xxx| 久久久精品久久久久久96| 亚洲视频小说之无码| 国产成人综合久久精品尤物| 99精品国产高清一区二区| 国产精品人妻99一区二区三区| 蒙自县| 55夜色66夜色国产精品视频| 香蕉久久av一区二区三区| 黑人巨茎精品欧美一区二区| 亚洲中文字幕毛片在线播放| 精品无码国产一区二区三区51安| 久久久国产精品| 国产日产精品_国产精品毛片| 一级毛片免费观看不卡视频| 欧美人与动牲交xxxxbbbb| 双牌县| 国产欧美自拍视频| 五月天精品视频在线观看| 欧美大片va欧美在线播放 | 亚洲欧美日韩综合久久久久|