1.

What is the difference between TreeSet and SortedSet?(a) TreeSet is more efficient than SortedSet(b) SortedSet is more efficient than TreeSet(c) TreeSet is an interface; SortedSet is a concrete class(d) SortedSet is an interface; TreeSet is a concrete classThe question was posed to me in semester exam.The question is from Data Structures-Set in section java.util – The Collections Framework of Java

Answer»

The correct answer is (d) SortedSet is an INTERFACE; TREESET is a concrete class

Explanation: SortedSet is an interface. It maintains an ORDERED set of ELEMENTS. TreeSet is an implementation of SortedSet.



Discussion

No Comment Found

Related InterviewSolutions