explain the both hashset and treesethashset is an


Explain the both HashSet and TreeSet?

HashSet is an unordered, unsorted Set.

It's a Collection set which restrict duplicate elements and also repositioning of elements.

It implements Set interface and extends AbstractSet.

Uses hash code of object being inserted.

TreeSet is a Set implemented when we want elements in a sorted order.

Sorting of element is done according to natural order of elements or by help of comparator provided at creation time.

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: explain the both hashset and treesethashset is an
Reference No:- TGS0355109

Expected delivery within 24 Hours