When Is The Object Eligible For Garbage Collection?

后端 未结 7 674
后悔当初
后悔当初 2020-11-27 07:22

In the code below, given that amethod has been called. At what point/line is the Object originally referenced by myObject, eligible for Garbage Col

7条回答
  •  鱼传尺愫
    2020-11-27 08:22

    No object is eligible for garbage collection here because you are creating two reference for the same object and you are giving null to only one reference but other reference is still pointing your object

提交回复
热议问题