LinkedHashSet is an implementation of Set Abstract Data Type (ADT). It extends from the HashSet class which in-turn implements Set Interface. The difference between the LinkedHashSet and HashSet is the property of maintaining the element ordering. LinkedList is just a container holding sequence of elements. By definition, Set should not contain duplicate elements. This property need not hold good for the LinkedList ADT. When elements should be duplicated and the order has to be maintained, one should use LinkedHashSet.
There are basically three standard ways to get an element from LinkedHashSet without changing it to a different data structure.
Please Login to comment...