class Beta{}
class Alpha{
static Beta b1;
Beta b2;
}
public class Tester{
public static void main(String[] args){
Beta b1=new Beta(); Beta b2=new Beta();
Alpha a1=new Alpha(); Alpha a2=new Alpha();
a1.b1=b1;
a1.b2=b1;
a1.b2=b2;
a1=nill; b1=null; b2=nill;
//do stuff
}
}问题:When line 16 is reached,how many objects will be eligible for garbage collection?
求各位大大解释,晚上结贴给分
class Alpha{
static Beta b1;
Beta b2;
}
public class Tester{
public static void main(String[] args){
Beta b1=new Beta(); Beta b2=new Beta();
Alpha a1=new Alpha(); Alpha a2=new Alpha();
a1.b1=b1;
a1.b2=b1;
a1.b2=b2;
a1=nill; b1=null; b2=nill;
//do stuff
}
}问题:When line 16 is reached,how many objects will be eligible for garbage collection?
求各位大大解释,晚上结贴给分
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货