java - 哪一行代码的obj符合垃圾收集器的收集标准?
黄舟
黄舟 2017-04-17 13:31:38
0
1
605
        Object aobj=new Object();
        Object bobj=new Object();
        Object cobj=new Object();
        aobj=bobj;
        aobj=cobj;
        cobj=null;
        aobj=null;

求解释一下为什么只有最后一行最后一行么^ . ^
那么之后在什么情况下,a、b obj 开始new的内存空间才会被回收

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
PHPzhong

Whether it is referenced is only an indicator for detecting the object. Explicitly setting it to NULL will help GC mark the object. When to recycle it depends on the specific GC strategy

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template