Remove ArrayList Object from Memory

后端 未结 5 616
北恋
北恋 2021-01-14 13:43

I have a bunch of Objects in an ArrayList, if I call ArrayList.remove(object) Do I need to do anything else to remove the object from memory? I am

5条回答
  •  花落未央
    2021-01-14 14:05

    ArrayList.remove removes the object from the array, and then if the object is not referenced to by any other objects, the GC will delete that object.

提交回复
热议问题