- The nature of Sets that there are no duplicates.
- The advantage of using a TreeSet is that it not only remove the duplicates, but also sorts the Data in Ascending order.
- The HashSet does not preserve the ordering the Set, so it can be used if you are not interested in ordering.
- The LinkedHashSet keeps the original ordering of the Set. So it is advisable to be used if you want to keep the original ordering of your Set!
Tuesday, November 8, 2016
Java Collection Properties One by One
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment