欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

多项选择题

class A { 
} 
class Alpha { 
private A myA = new A(); 
void dolt( A a ) { 
a = null; 
} 
void tryIt() { 
dolt( myA ); 
} 
} 
Which two statements are correct?()  

    A. There are no instanced of A that will become eligible for garbage collection.
    B. Explicitly setting myA to null marks that instance to be eligible for garbage collection.
    C. Any call on tryIt() causes the private instance of A to be marked for garbage collection.
    D. Private instances of A become eligible for garbage collection when instances of Alpha become eligible for garbage collection.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题