The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes difference between sortedmap and treemap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "difference between sortedmap and treemap" Watch "difference between sortedmap and treemap" New topic

difference between sortedmap and treemap

Chris Davies
Ranch Hand

Joined: Feb 26, 2003
Posts: 110
what is the difference betwen these two interfaces ?

is it the same as sortedet and treeset ?

both seem to sort in order ? is it the key /value issue ?



One day all greenhorns will run free ...
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
It looks to me that TreeMap is an implementation of the interface SortedMap. (As TreeSet is an implementation of SortedSet). So a comparison seems to be meaningless.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: difference between sortedmap and treemap
It's not a secret anymore!