I am preparing for OCPJP7 and for that first sitting for OCPJP6 exam. I want to know in the javadocs, it is written that TreeSet is implemented using TreeMap instance. What does it mean?
Thanks a ton for your prompt response. The confusion is, it says the TreeSet implementation is based on TreeMap. How is that?
I can see that TreeSet is composed of TreeMap. It means that, whatever the added functionality TreeMap provides like navigation
and searching is implicitly done in TreeSet via TreeMap. Am i am understanding it correct?
TreeSet data structure HAS-A TreeMap. In TreeMap, there is a key-value pair.
In TreeSet, there is a key-value pair as well. But in TreeSet, the value is always null. In TreeMap, the value is whatever value you declare.