What is the difference between them? I know that
A LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all el
LinkedHashSet's constructors invoke the following base class constructor:
HashSet(int initialCapacity, float loadFactor, boolean dummy) {
map = new LinkedHashMap(initialCapacity, loadFactor);
}
As you can see, the internal map is a LinkedHashMap. If you look inside LinkedHashMap, you'll discover the following field:
private transient Entry header;
This is the linked list in question.