filmov
tv
Java LinkedHashSet constructors | Java LinkedHashSet (Java Tutorial)
Показать описание
******************** Java LinkedHashSet Properties:
It contains only unique elements.
It maintains insertion order.
It implements Set interface.
It extends HashSet class.
Java LinkedHashSet Constructors:
LinkedHashSet() - It is the default constructor and creates an empty object.
LinkedHashSet(Collection c) - It creates an object using the elements of the collection c
LinkedHashSet(int capacity) - It creates an object with the initial capacity.
LinkedHashSet(int capacity, int fillRatio) - It creates an object by initialize the initial capacity and fill ratio.
Java LinkedHashSet Methods:
boolean add(Object targetObject) - It adds the targetObject in the set.
void clear() - It removes all the elements from the set.
Object clone() - It copies all the elements from the existing object and creates a new set object.
boolean isEmpty() - It returns if the set doesn't contain any elements.
boolean remove(Object o) - It removes the specified object from the set.
int size() - It returns the total elements count of the set.
#javalinkedhashset #javacollections #programmingline #rakesh #rake
*******************************************************
Important Links:
*******************************************************
Subscribe my YouTube channels:
*******************************************************