InterviewSolution
| 1. |
What Is Linkedhashset? |
|
Answer» LinkedHashSet is also one of the implementation of the SET INTERFACE. Actually LinkedHashSet class extends the HashSet and has no other methods of its own. LinkedHashSet also STORES unique elements just like other implemetations of the Set interface. How LinkedHashSet differs is that it MAINTAINS the insertion-order; that is elements in the LinkedHashSet are stored in the SEQUENCE in which they are inserted. Note that insertion order is not affected if an element is re-inserted into the set. LinkedHashSet is also one of the implementation of the Set interface. Actually LinkedHashSet class extends the HashSet and has no other methods of its own. LinkedHashSet also stores unique elements just like other implemetations of the Set interface. How LinkedHashSet differs is that it maintains the insertion-order; that is elements in the LinkedHashSet are stored in the sequence in which they are inserted. Note that insertion order is not affected if an element is re-inserted into the set. |
|