LinkedHashSet
A LinkedHashSet is a collection in Java that combines the features of a hash table and a linked list. It stores elements in a hash table for fast access while maintaining the order of insertion using a linked list. This means that when you iterate over a LinkedHashSet, the elements will appear in the order they were added.
One of the main advantages of a LinkedHashSet is that it prevents duplicate entries, ensuring that each element is unique. It is part of the Java Collections Framework and is useful when you need both fast lookups and predictable iteration order.