In Java, how is an array of garbage arrays collected?

When an array of objects is no longer referenced, are the objects in this array also garbage collected? (if no variables refer to elements)

On this page http://java.sys-con.com/node/37613 it says - "The biggest danger is putting the object in the collection and forgetting to delete it. The memory used by this object will never be restored."

If you are sure to reset the links, why this memory will not be declared?

thank

+5
source share
4 answers

When an array of objects is no longer referenced, are the objects in this array also garbage collected? (subject to the absence of variable references to elements)

Yes.

" . , , ".

. , Map, -, , . , http-, - ServerContext , .

+4

, : .

, , , - , , ..

+2

, . , , (, ), .

+1

, , , - . , , .

, :

  • .
  • , , , , , , , ( ).
+1
source

All Articles