What is LinkedHashSet class?

What is LinkedHashSet class?

- LinkedHashSet combines the operations of LinkedList and HashSet, with the order of prediction for iteration.
- The implementation differs from HashSet by maintaining a doubly-linked list running.
- The LinkedHashSet class will extend the HashSet, but it does not add its own members.
- A linked list of the entries is maintained in the set, in the order in which they were inserted. This in turn allows insertion-order iteration over the set.
- While cycling through a LinkedHashSet by using an iterator, the elements are returned in the order in which they were inserted.
- The hash code is used as the index where the data associated with the key is stored.
- The key is transformed into its hash code automatically.
What is Map and SortedMap Interface?
What is Map and SortedMap Interface? - A map is an object that maps the keys to values. Map provides the facility of storing elements without....
What is casting? What are the different types of Casting?
What is casting? What are the different types of Casting? - Type casting: Explicit conversion between incompatible types ( or ) changing entities from one data type.....
Java - Advantages and disadvantages of interfaces
Advantages and disadvantages of interfaces - Interfaces are mainly used to provide polymorphic behavior, Interfaces function to break up the complex..
Post your comment