black

Java认证考试综合练习

登录

单项选择题

1.public class GC{
2.private Objec to;
3.private void doSomethingElse(Object obj){o=obj;}
4.public void doSomething(){
5.Object o=new Object();
6.doSomethingElse(o);
7.o=new Object();
8.doSomethingElse(null);
9.o=null;
10.}
11.}
When the doSomething method is called,after which line does the Object created in line 5 become available for garbage collection?()

A.Line5
B.Line6
C.Line7
D.Line8
E.Line9
F.Line10

相关考题

单项选择题 11.class Snoochy{ 12.Boochybooch; 13.public Snoochy(){booch=newBoochy(this);} 14.} 15. 16.class Boochy{ 17.Snoochy snooch; 18.public Boochy(Snoochys){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?()

单项选择题 11.rbo = new ReallyBigObject(); 12.//more code here 13.rbo = null; 14./*insert code here*/ Which statement should be placed at line 14 to suggest that the virtual machine expend effort toward recycling the memory used by the objectrbo?()

单项选择题 package test; class Target{ public String name="hello"; } What can directly access and change the value of the variable name?()

All Rights Reserved 版权所有©求知题库网库(csqiuzhi.com)

备案号:湘ICP备14005140号-1

经营许可证号:湘B2-20140064