LinkedHashSet:
The LinkedHash Set is part of collection framework and it is
available in “java.util” package.
LinkedHashSet Implements Set, Cloneable, Serializable
interfaces and extends HashSet class.
LinkedHashSet similar to HashSet class. but it maintains the
insertion order.
LinkedHashSet contains unique elements.
LinkedHashSet uses a hash table & doubly linked list to
store & maintain the elements.
LinkedHashSet allows one null value.
LinkedHashSet is non-synchronized.
Creation of LinkedHashSet:
LinkedHashSet <E> hs = new LinkedHashSet <E>();
LinkedHashSet <E> hs = new LinkedHashSet <E>(int capacity);
Java Code:
No comments:
Post a Comment