Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFE page 72

 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this question was raised by Torean ...I spent quite a bit of time to solve it & came up with a question on values() from hashmap returns a collection, what we can do is to fill the returned collection into an arraylist to make the objects surely serializable as the book says, but my question is ?
i went through the AbstractList class and it does not implement
the serializable interface ,may be that is why the returned collection be fed into a known collection implementing class(to make sure that the classs is serializable),
but the book says in 72-page that all collection implementations are serializable ?
please help me & Torean
thanks
 
Thomas De Vos
stable boy
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not too sure what is mentioned in the book.
All the implementation classes of the Collection interface implements the Serializable interface. Have a look to the JDK API doc for HashSet, TreeSet, HashMap, ArrayList, etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic