TreeSet and TreeMap are two different Collection class in java.TreeSet implements Set interface whereas TressMap impements Map interface.
TreeSet Vs TreeMap
|
TreeSet
|
TreeMap
|
Implementation
|
It implements Set interface.
|
It implements Map interface.
|
Storing Objects
|
TressSet stores only one objects.
|
TreeMap stores two objects i.e.key and value.
|
Duplicates
|
TreeSet does not allow duplicates value.
|
TreeMap allows duplicate values.
|
Specific Implementation
|
It implements NavigableSet.
|
It implements NavigableMap.
|
Study Well.Enjoy Reading.
No comments:
Post a Comment