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

正文內(nèi)容

ocp題庫解析僅供參考-在線瀏覽

2025-02-24 09:31本頁面
  

【正文】 21. (s + + subs)。 TreeSet 是一個(gè)有序集,所以其中的元素必須是有序的。 看下面的例子,首先移除一個(gè) 15,發(fā)現(xiàn)原始的 treeSet和 subset里面的 15 都沒了,而 treeSet加上 15 之后,原始的 treeSet 和 subset 里面的 15 又都出現(xiàn)了。 2. import 。 7. TreeSetInteger subSet = new TreeSetInteger()。 i = 20。 10. subSet = (TreeSetInteger) (13, true, 16, true)。//[13, 14, 15, 16] 12. (15)。//[13, 14, 16] 14. (treeSet)。 16. (subSet)。//[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] 18. } 19. } : 1. public class Score implements ComparableScore { 2. private int wins, losses。 losses = l。 } 5. public int getLosses() { return losses。 8. } 9. // insert code here 10. } Which method will plete this class? 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*/ } Answer: B 實(shí)現(xiàn) ComparableScore 接口必須實(shí)現(xiàn) parToScore 方法!注意與 Compartor 接口區(qū)分開來, Compartor 接口要求實(shí)現(xiàn) Compare 方法。 13. public Person(String name) { 14. = name。 18. } 19. } Which statement is true? A. The time to find the value from HashMap with a Person key depends on the size of the map. B. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person. C. Inserting a second Person object into a HashSet will cause the first Person object to be removed as a duplicate. D. The time to determine whether a Person object is contained in a HashSet is constant and does NOT depend on the size of the map. Answer: A B 選項(xiàng): 刪除 HashMap 中一個(gè) Person 對(duì)象對(duì)應(yīng)的鍵將會(huì)刪除這個(gè)散列映射表中 Person 類的全部條目 。所以說,刪除一個(gè)鍵對(duì)應(yīng)的 Person 對(duì)象并不會(huì)刪除所有的條目,他們的 key 都不同嘛。錯(cuò)誤,雖然 Person對(duì)象的 hashCode 方法返回的值都是 420,這僅 僅表明兩個(gè) Person 對(duì)象在一個(gè) entry 鏈表中,接下來要調(diào)用 equals 方法,由于 Person 類沒有 equals 方法,所以調(diào)用 Object 的 equals 方法返回對(duì)象的存儲(chǔ)地址,很明顯兩個(gè) Person 對(duì)象的存儲(chǔ)地址是不同的。 D 選項(xiàng): 判斷一個(gè) HashSet 中是否存在一個(gè) Person 對(duì)象的次數(shù)是常數(shù)次,和 map 的大小無關(guān) 。 A:選項(xiàng): 由 key 來查找 value 的次數(shù)與 map 的大小有關(guān) 。 : 5. import .*。 9. (1)。 (3)。 12. (2)。 14. (a)。實(shí)現(xiàn)了排序,而 reverse 方法是反轉(zhuǎn)集合中的所有元素。 13. } Which three are valid on line 12? (Choose three. )A. final B. static C. native D. public E. private F. abstract G. protected Answer: A,B,D 接口中,變量默認(rèn)是 public static final,而方法默認(rèn)是 public,不能改變。 } 7. } 8. class Rock extends Atom { 9. Rock(String type) { (type)。 14. new Rock(granite )。 } 17. } What is the result? A. Compilation fails. B. atom granite C. granite granite D. atom granite granite E. An exception is thrown at runtime. F. atom granite atom granite Answer: F 當(dāng)調(diào)用子類的構(gòu)造函數(shù)的時(shí)候,如果沒有顯式調(diào)用父類的構(gòu)造函數(shù),那么父類的默認(rèn)構(gòu)造函數(shù)將被調(diào)用,如果父類沒有默認(rèn)的構(gòu)造函數(shù),編譯器就會(huì)警告出錯(cuò)。 所以當(dāng)調(diào)用 Beta 類型對(duì)象的 testFoo 方法時(shí),將輸出第 28 行的內(nèi)容, new A()調(diào)用的是局部內(nèi)部類 A 的構(gòu)造函數(shù),返回一個(gè)局部內(nèi)部類 A 給 fubar()函數(shù),最終輸出 2。如果刪除24, 25, 26 行,那么本來被這個(gè)局部內(nèi)部類屏蔽的不可見的局部類 A 變得可見,輸出自然也是 1 了。} 12. public Point getPoint() { return new Point()。 B. p = () 。 D. p = (new Line()).getPoint() 。//其中 method 方法返回 類型的對(duì)象 : 11. class Alpha { 12. public void foo() { (Afoo )。 } 16. public static void main(String[] args) { 17. Alpha a = new Beta()。 19. ()。 21. } 22. } What is the result? A. Afoo Afoo B. Afoo Bfoo C. Bfoo Afoo D. Bfoo Bfoo E. Compilation fails. F. An exception is thrown at runtime. Answer: D 考察多態(tài)性,編譯器認(rèn)為 a 是 Alpha 類型, b 是 Beta 類型 ,但是虛擬機(jī)知道 a 和 b 的真實(shí)類型是 Beta,所以調(diào)用 Beta 類的函數(shù)。上題中 C 類中有方法 Object execute() 以及 String execute(), Object不是 Strng 類型的子類型,所以錯(cuò)誤。 B. static final int[] a。 a[0]=100。 } C. static final int[] a = new int[2]{ 100,200 } 。 static void init() { a = new int[3]。 a[1]=200。 A 選項(xiàng)是經(jīng)典定義。類的初始化是按照這樣的順序進(jìn)行的:首先定義域 field,然后就會(huì)執(zhí)行靜態(tài)初始化塊,然后再執(zhí)行構(gòu)造函數(shù)。 D 中 init()方法在初始化的時(shí)候根本就不會(huì)執(zhí)行,除非你在某個(gè)函數(shù)中顯式調(diào)用。 } 11. public class Sprite { 12. public int fubar( Foo foo ) { return ()。 17. } 18. } Which code, inserted at line 15, allows the class Sprite to pile?A. Foo { public int bar() { return 1。 } C. new Foo() { public int bar() { return 1。 } Answer: C 匿名內(nèi)部類。 4. int [][]y = x。 6. } 7. } What is the result?A. 2 B. 3 C. 4 D. 6 E. 7 F. Compilation fails. Answer: E 很簡單的數(shù)組題。 : 22. StringBuilder sb1 = new StringBuilder(123)。 24. // insert code here 25. (sb1 + + s1) 。 (abc) 。 (abc) 。 (abc) 。 (abc) 。 s1 = (abc) 。 s1 = (abc) 。 s1 = s1 + (abc) 。 s1 = s1 + (abc) 。 String 類有一個(gè) concat 函數(shù), String str = (one)。而 StringBuilder 的 append 方法, (one)。 that the current directory is empty, and that the user has read and write permissions, and the following: 11. import .*。 15. ()。 17. try { 18. ()。 } 20. File newDir = new File(newDir)。 22. } 23. } Which statement is true? A. Compilation fails. B. The file system has a new empty directory named dir. C. The file system has a new empty directory named newDir. D. The file system has a directory named dir, containing a file . E. The file system has a directory named newDir, containing a file . Answer: E 考察 包。 14. int j = 12。 16. } 17. } What is the result when the programmer attempts to pile the code and run it with the mand java Converter 12? A. It is true that j==i. B. It is false that j==i. C. An exception is thrown at runtime. D. Compilation fails because of an error in line 13. Answer: D args 是一個(gè) String 類型的數(shù)組,第 13 行應(yīng)該是 int i = (args[0])。 12. // insert code here 13. String[] result = (regex)。 B. String regex = 。 D. String regex = \\s。 F. String regex = \\w[ \.] +。表示根據(jù)點(diǎn)( dot)和空格( space)來分割字符串。 6. import 。 22. Date date = new Date()。 Which code fragment, inserted at line 23, allows the code to pile? A. df = new DateFormat()。 C. df = ()。 E. df = ()。 2. 3. public class Repetition { 4. public static String twice(String s) { return s + s。 6. } 7. } Which code should be inserted at line 1 of to pile and run Demo to print pizzapizza? A. import utils.*。 C. import
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1