Java LinkedHashSet - Smart Tech Guides

Latest

Hi this is Sravan Kumar from India. SMART TECH GUIDES is a technical blog. it helps you to learn about Java topics, frameworks and tools like Jenkins, GitHub & related explanations, data base related topics. All these Explanations are explained in simple and understandable manner.

Subscribe Us

SMART TECH GUIDES

Java LinkedHashSet

 

LinkedHashSet:

The LinkedHash Set is part of collection framework and it is available in “java.util” package.

LinkedHashSet Implements Set, Cloneable, Serializable interfaces and extends HashSet class.

LinkedHashSet similar to HashSet class. but it maintains the insertion order.

LinkedHashSet contains unique elements.

LinkedHashSet uses a hash table & doubly linked list to store & maintain the elements.

LinkedHashSet allows one null value.

LinkedHashSet is non-synchronized.


Creation of LinkedHashSet:

LinkedHashSet <E> hs = new LinkedHashSet <E>();

LinkedHashSet <E> hs = new LinkedHashSet <E>(int capacity);



Java Code:


Output:

No comments:

Post a Comment