LinkedHashSet in Java

The LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. 
When iterating through a HashSet the order is unpredictable, while a LinkedHashSet lets us iterate through the elements in the order in which they were inserted. 
* It extends the HashSet class and implements the Set interface.
* It contains unique elements only like HashSet. 
* It maintains insertion order.

```Java
import java.util. * ;

public class Main {
    public static void main(String args[]){
        LinkedHashSet<String> s = new LinkedHashSet();
        s.add("a");
        s.add("c");
        s.add("b");
        Iterator<String> itr = s.iterator();
        while(itr.hasNext()) {
            System.out.println(itr.next());
        }
    }
}
```