This content has been marked as final. Show 4 replies
In arrayCollection = null; statement you're setting this reference to null and potentially making it available for garbage collection. I say 'this reference' and potentially because, as you may know, there might be other references to this array collection object that won't be affected by this statement and hence it won't be GC'ed.
arrayCollection.removeAll() says that I want to empty this array collection for all the reference that we pointing to it. That is, remove all the objects from the collection -- and of course make them 'potentially' available for the GC -- the size of the array collection would be reduced down to zero and all the references would be pointing to a valid but empty collection.
Hope this helps.
...the same as:
myArrayCollection = new ArrayCollection();
only when myArrayCollection is the only reference to the underlying collection object, yes.