The Artima Developer Community
Sponsored Link

Legacy Design Forum
Finalization and Cleanup

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

WeakHashMap question

Posted by alok pota on February 16, 2001 at 11:33 AM

WeakHashMap h1 = new WeakHashMap();
String s = "1";
h1.put("1","1");

HashMap h2 = new HashMap();
String t = "3333";
h2.put(t,s);

Will the WeakHashMap be effective at all, since the second hashmap holds a Strong reference to the key of the WeakHashMap?




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us