Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Hi there, My question is about objects reusing in serialization. Suppose such a code : HashMap hm = new HashMap(); for (int i=0;i<10;i++){
So if i use hashmap clearing and filling then flushing. Then i deserialize it and I get printed list where every Hashmap is the same, as first one (in this case all objects has the same entry "int"=0) If create new object (in code commented out) then everything's fine. How can I reuse object ? Why it doesn't work ? Thanx Tony
Replies:
|
Sponsored Links
|