How to free/GC HashMap on one shot (without iterating)?
I have some HashMap < String, XYZ > created having the key type as String
and value type of some XYZ Class.Now for some condition check I want to
free/ garbage collect the entire HashMap along with the individual objects
of XYZ type that it holds. Is it possible to do it without iterating the
hash map and setting each object to null ? I guess by setting only HashMap
to null will not work. How do I ensure later that the collection of
objects is garbage collected ?
No comments:
Post a Comment