Java Deque removeFirstOccurrence() MethodThe removeFirstOccurrence() method of Deque interface is used to remove the first occurrence of the given element from the deque. If there is no element in the deque, then it remains unchanged. It may return true if the deque contains the specified element. Syntax:Parameter:The above requires only one parameter:
Return:The above method returns true if the particular element is removed from the deque. Throw:
Example 1Test it NowOutput: The character is already present? true The final deque is given as : a b d Example 2Test it NowOutput: The integer value is already preesnt? true The final deque is given as : 7 6 2 Example 3Test it NowOutput: The float value is already preesnt? false The final deque is given as : 71.2 63.4 50.8 66.8 Next TopicJava Deque |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India