![]() |
VOOZH | about |
Array_Deque.remove()Parameters: The method does not take any parameters. Return Value: This method returns the element present at the head of the Deque. Exceptions: The method throws NoSuchElementException is thrown if the deque is empty. Below programs illustrate the Java.util.ArrayDeque.remove() method: Program 1:
Initial ArrayDeque: [Welcome, To, Geeks, For, Geeks] ArrayDeque after removing elements: [Geeks, For, Geeks]
Initial ArrayDeque: [10, 15, 30, 20, 5] ArrayDeque after removing elements: [30, 20, 5]
Priority_Queue.remove(Object O)Parameters: The parameter O is of the type of ArrayDeque and specifies the element to be removed from the ArrayDeque. Return Value: This method returns True if the specified element is present in the Deque else it returns False. Below programs illustrate the Java.util.ArrayDeque.remove() method: Program 1:
Initial ArrayDeque: [Welcome, To, Geeks, For, Geeks] ArrayDeque after removing elements: [To, Geeks]
Initial ArrayDeque: [10, 15, 30, 20, 5] ArrayDeque after removing elements: [10, 15, 20]