网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
11. class Snoochy { 12. Boochybooch; 13. public Snoochy() { booch = new Boochy(this); } 14. } 15. 16. class Boochy { 17. Snoochy snooch; 18. public Boochy(Snoochy s) { snooch = s; } 19. } And the statements: 21. public static void main(String[] args) { 22. Snoochy snoog = new Snoochy(); 23. snoog = null; 24. // more code here 25. } Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?()
A
None of these objects are eligible for garbage collection.
B
Only the object referenced by booch is eligible for garbage collection.
C
Only the object referenced by snoog is eligible for garbage collection.
D
Only the object referenced by snooch is eligible for garbage collection.
E
The objects referenced by snooch and booch are eligible for garbage collection.
参考答案
参考解析
解析:
暂无解析
更多 “单选题11. class Snoochy { 12. Boochybooch; 13. public Snoochy() { booch = new Boochy(this); } 14. } 15. 16. class Boochy { 17. Snoochy snooch; 18. public Boochy(Snoochy s) { snooch = s; } 19. } And the statements: 21. public static void main(String[] args) { 22. Snoochy snoog = new Snoochy(); 23. snoog = null; 24. // more code here 25. } Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?()A None of these objects are eligible for garbage collection.B Only the object referenced by booch is eligible for garbage collection.C Only the object referenced by snoog is eligible for garbage collection.D Only the object referenced by snooch is eligible for garbage collection.E The objects referenced by snooch and booch are eligible for garbage collection.” 相关考题
考题
单选题You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability?()A
Java.util.Map.B
Java.util.Set.C
Java.util.List.D
Java.util.StoredSet.E
Java.util.StoredMap.F
Java.util.Collection.
考题
多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() { public void run() { doStuff(); } }Bnew Thread() { public void start() { doStuff(); } }Cnew Thread() { public void start() { doStuff(); } } .run();Dnew Thread() { public void run() { doStuff(); } } .start();Enew Thread(new Runnable() { public void run() { doStuff(); } } ).run();Fnew Thread(new Runnable() { public void run() { doStuff(); } }).start();
考题
多选题Which two CANNOT directly cause a thread to stop executing? ()AExisting from a synchronized block.BCalling the wait method on an object.CCalling notify method on an object.DCalling read method on an InputStream object.ECalling the SetPriority method on a Thread object.
考题
多选题Which statements concerning casting and conversion are true?()AConversion from int to long does not need a cast.BConversion from byte to short does not need a cast.CConversion from float to long does not need a cast.DConversion from short to char does not need a cast.EConversion from boolean to int using a cast is not possible.
考题
单选题Consider the following class: class Test(int i) { void test(int i) { System.out.println(“I am an int.”); } void test(String s) { System.out.println(“I am a string.”); } public static void main(String args) { Test t=new Test(); char ch=“y”; t.test(ch); } } Which of the statements below is true?()A
Line 5 will not compile, because void methods cannot be overridden.B
Line 12 will not compile, because there is no version of test() that rakes a charargument.C
The code will compile but will throw an exception at line 12.D
The code will compile and produce the following output: I am an int.E
The code will compile and produce the following output: I am a String.
热门标签
最新试卷