I have a class, SortedHashSet.
It is supposed to incorporate both TreeSet and HashSet. The class is as below:
class SortedHashSet<T> extends TreeSet<T>
I have to override the add function such that it will maintain a TreeSet and a HashSet.
Can anyone advise me how it can be done?
For HashSet, I will need to declare a variable of type, HashSet. How about TreeSet?
Thanks in advance.