• Post Reply Bookmark Topic Watch Topic
  • New Topic

HashSet vs TreeSet vs LinkedHashSet  RSS feed

 
Niki Kulkarni
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

What is the difference between HashSet, TreeSet and LinkedHashSet?.

One difference between HashSet and TreeSet is that TreeSet is sorted, whereas HashSet is not sorted.

I dont know the other differences
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the API documentation of those classes? It explains exactly what each of the classes is. And the documentation of LinkedHashSet explains what the difference is with a normal HashSet.
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This Java Tutorials section will probably help, too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!