Java
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 Read more…
The add(E element) method of HashSet inserts the specified element into the set. It returns false if the set already Read more…
The add(E element) of LinkedList appends the specified element at the end of the list. We can also add an Read more…
The addFirst(E element) method of LinkedList appends the specified element at the beginning of this linked list. It does not Read more…
The addLast(E element) method of LinkedList appends the specified element at the end of this linked list. It does not Read more…
The clear(E element) method of LinkedList removes all the elements from this list. The linked list becomes empty as a Read more…
The contains(E element) method of LinkedList checks if the LinkedList contains the specified element or not. It returns true if Read more…
The element() method of LinkedList retrieves but does not remove the first element of this linked list. It throws NoSuchElementException Read more…
The get(int index) method of LinkedList returns the element at the specified index in this list. It throws IndexOutOfBoundsException if Read more…
The getFirst() method of LinkedList returns the first element of this linked list. It throws NoSuchElementException if this linked list Read more…
The getLast() method of LinkedList returns the last element of this linked list. It throws NoSuchElementException if this linked list Read more…