freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java基礎(chǔ)部分面試千題庫(編輯修改稿)

2024-09-24 18:09 本頁面
 

【文章內(nèi)容簡介】 e } 18. } 下列哪句代碼放到第 16 行,可以導(dǎo)致一個(gè) ( ) a) Alpha a = x。 b) Foo f = (Delta)x。 c) Foo f = (Alpha)x。 d) Beta b = (Beta)(Alpha)x。 37) 22. public void go() { String o = 。 z: . for(int x = 0。 x 3。 x++) { for(int y = 0。 y 2。 y++) { if(x==1) break。 if(x==2 amp。amp。 y==1) break z。 o = o + x + y。 } } (o)。 }當(dāng)調(diào)用 go 方法時(shí),輸出結(jié)果是什么( ) a) 00 b) 0001 c) 000120 d) 000120221 38) 11. static void test() throws RuntimeException { try { (test )。 throw new RuntimeException()。 } catch (Exception ex) { (exception )。 } } public static void main(String[] args) { try { test()。 } catch (RuntimeException ex) { (runtime )。 } (end )。 }程序運(yùn)行結(jié)果是( ) a) test end b) Compilation fails. c) test runtime end d) test exception end e) .A Throwable is thrown by main at runtime 39) 33. try { // some code here } catch (NullPointerException e1) { (a)。 } catch (Exception e2) { (b)。 } finally { (c)。 }如果程序的第 34 行會(huì)拋出一些異常,程序的運(yùn)行結(jié)果是( ) a) a b) b c) c d) ac e) abc 40) 31. // some code here try { // some code here } catch (SomeException se) { // some code here } finally { // some code here } 哪種情況下 37 行的代碼會(huì)執(zhí)行,請(qǐng)選擇 3 個(gè)( ) a) The instance gets garbage collected. b) The code on line 33 throws an exception. c) The code on line 35 throws an exception. d) The code on line 31 throws an exception. e) The code on line 33 executes successfully. 41) 10. int x = 0。 int y = 10。 do { y。 ++x。 } while (x 5)。 (x + , + y)。 程序運(yùn)行結(jié)果是( ) a) 5, 6 b) 5, 5 c) 6, 5 d) 6, 6 42) public class Drink { public static void main(String[] args) { boolean assertsOn = true。 assert (assertsOn) : assertsOn = true。 if(assertsOn) { (assert is on)。 } } }程序運(yùn)行結(jié)果是( ) a) no output b) no output assert is on c) assert is on d) assert is on An AssertionError is thrown. 43) 11. Float pi = new Float()。 if (pi 3) { (pi is bigger than 3. )。 } else { (pi is not bigger than 3. )。 } finally { (Have a nice day.)。 }程序運(yùn)行結(jié)果是( ) a) Compilation fails. b) pi is bigger than 3 c) An exception occurs at runtime. d) pi is bigger than 3. Have a nice day. e) pi is not bigger than 3. Have a nice day. 44) 1. public class Boxer1{ Integer i。 int x。 public Boxer1(int y) { x = i+y。 (x)。 } public static void main(String[] args) { new Boxer1(new Integer(4))。 } }運(yùn)行結(jié)果是( ) a) The value 4 is printed at the mand line. b) Compilation fails because of an error in line 5. c) A NullPointerException occurs at runtime. d) A NumberFormatException occurs at runtime. 45) 1. public class Person { private String name。 public Person(String name) { = name。 } public boolean equals(Person p) { return ()。 6. } 7. } 下列哪條語句是正確的( ) a) The equals method does NOT properly override the method. b) Compilation fails because the private attribute cannot be accessed in line 5. c) To work correctly with hashbased data structures, this class must also implement the hashCode method. d) When adding Person objects to a collection, the equals method in line 4 will prevent duplicates. 46) 1. public class Score implements Comparable { private int wins, losses。 public Score(int w, int l) { wins = w。 losses = l。 } public int getWins() { return wins。 } public int getLosses() { return losses。 } public String toString() { return + wins + , + losses + 。 } // insert code here }下列哪句代碼放到第 9 行,程序可以正確編譯( ) a) public int pareTo(Object o){/*more code here*/} b) public int pareTo(Score other){/*more code here*/} c) public int pare(Score s1,Score s2){/*more code here*/} d) public int pare(Object o1,Object o2){/*more code here*/} 47) 3. public class Batman { int squares = 81。 public static void main(String[] args) { new Batman().go()。 } void go() { incr(++squares)。 (squares)。 } void incr(int squares) { squares += 10。 } }程序運(yùn)行結(jié)果是( ) a) 81 b) 82 c) 91 d) 92 48) 15. public class Yippee { public static void main(String [] args) { for(int x = 1。 x 。 x++) { (args[x] + )。 19. } 20. } 21. } 在控制臺(tái)依次輸入兩條命令 java Yippee java Yippee 1 2 3 4 程序的運(yùn)行結(jié) 果是( ) a) No output is produced. 1 2 3 b) No output is produced. 2 3 4 c) No output is produced. 1 2 3 4 d) An exception is thrown at runtime. 1 2 3 e) An exception is thrown at runtime. 2 3 4 f) An exception is thrown at runtime. 1 2 3 4 49) 13. public class Pass { public static void main(String [] args) { int x = 5。 Pass p = new Pass()。 (x)。 ( main x = + x)。 } 21. void doStuff(int x) { ( doStuff x = + x++)。 } }程序的運(yùn)行結(jié)果是( ) a) Compilation fails. b) An exception is thrown at runtime. c) doStuff x = 6 main x = 6 d) doStuff x = 5 main x = 5 e) doStuff x = 5 main x = 6 f) doStuff x = 6 main x = 5 50) 3. interface Animal { void makeNoise()。 } class Horse implements Animal { Long weight = 1200L。 public void makeNoise() { (whinny)。 } } public class Icelandic extends Horse { public void makeNoise() { (vinny)。 } public static void main(String[] args) { Icelandic i1 = new Icelandic()。 Icelandic i2 = new Icelandic()。 12. Icelandic i3 = new Icelandic()。 i3 = i1。 i1 = i2。 i2 = null。 i3 = i1。 } }程序運(yùn)行結(jié)束后,有幾個(gè)對(duì)象符合垃圾回收的條件( ) a) 0 b) 1 c) 2 d) 3 e) 4 f) 6 51) 11. String[] elements = { for, tea, too }。 String first = ( 0) elements[0] : null。 程序運(yùn)行結(jié)果是( ) a) Compilation fails. b) An exception is thrown at runtime. c) The variable first is set to null. d) The variable first is set to elements[0]. 52) 31. class Foo { public int a = 3。 public void addFive() { a += 5。 (f )。 } } class Bar ext
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1