Difference between HashSet and TreeSet.
Difference between HashSet and TreeSet can be seen below:
HashSet | TreeSet |
---|
Inserted elements are in random order | Maintains the elements in the sorted order |
Can able to store null objects | Couldn’t store null objects |
Performance is fast | Performance is slow |