This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Difference between TreeSet and SortedSet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Difference between TreeSet and SortedSet" Watch "Difference between TreeSet and SortedSet" New topic
Author

Difference between TreeSet and SortedSet

selvam kumar
Greenhorn

Joined: Nov 12, 2011
Posts: 17
hello friends
what is the diff between treeset and sortedset?? ??
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2407
TreeSet is a concrete class, whereas SortedSet is an interface (which happens to be implemented by TreeSet). Apart from that, their respective javadocs are quite different; what did you learn from studying those?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 5888
    
    6

selvam kumar wrote:hello friends
what is the diff between treeset and sortedset?? ??


http://lmgtfy.com/?q=what+is+the+diff+between+treeset+and+sortedset
http://docs.oracle.com/javase/6/docs/api/java/util/TreeSet.html
http://docs.oracle.com/javase/6/docs/api/java/util/SortedSet.html

Please make an effort to do some research before posting to a forum. Then, if you're still confused, post more specific questions, referring back to the research you did as appropriate. You'll find this is a more productive and rewarding way to learn.

Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Please UseAMeaningfulSubjectLine. "java" doesn't describe the problem. Wouldn't "Difference between TreeSet and SortedSet" be much more describing?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

And that's what I've turned it to.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Harsha Smith
Ranch Hand

Joined: Jul 18, 2011
Posts: 287
NavigableSet is an interface that extends and replaces sortedset. TreeSet implements NavigableSet. Available since java SE 1.6
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

NavigableSet doesn't replace SortedSet, it adds to it. If you want to create a Set implementation that doesn't need any of the methods added by NavigableSet then SortedSet is still the interface to implement.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between TreeSet and SortedSet
 
Similar Threads
collection to string array possible!
Collection
Vector
Diff between TreeSet and SortedSet
navigable set and sorted set