Press "Enter" to skip to content

Posts published in “Java”

HashSet isEmpty() Method in Java

The isEmpty() method of HashSet checks if the HashSet is empty or not. If the HashSet is empty then it returns true otherwise returns false.…

HashSet clone() Method in Java

The clone() method of HashSet returns a shallow copy of this HashSet instance. It overrides the clone() method of Object. Syntax Parameters It does not…

HashSet remove() Method in Java

The remove(Element e) method of HashSet removes the specified element from the set. Syntax Parameters e is the element to be removed Return Value It…

HashSet size() Method in Java

The size() method of HashSet returns the number of elements available in the HashSet. Syntax Parameters It does not take any parameter Return Value It…

HashSet contains() Method in Java

The contains(Element e) method of HashSet checks if the HashSet contains the specified element or not. It returns true if the HashSet contains the specified…

HashSet add() Method in Java

The add(E element) method of HashSet inserts the specified element into the set. It returns false if the set already contains the specified element otherwise…

LinkedList add() Method in Java

The add(E element) of LinkedList appends the specified element at the end of the list. We can also add an element at a specific position…

LinkedList addFirst() Method in Java

The addFirst(E element) method of LinkedList appends the specified element at the beginning of this linked list. It does not return anything. Syntax Parameters e…

LinkedList addLast() Method in Java

The addLast(E element) method of LinkedList appends the specified element at the end of this linked list. It does not return anything. Syntax Parameters e…