Java LinkedTransferQueue remove() methodThe remove() method of Java LinkedTransferQueue class is used to remove the specified element from the queue if that element is present in the queue. This method of LinkedTransferQueue class overrides the remove in class AbstractCollection Syntax:Parameters:The parameter 'o' is the element to be removed from the queue if it is present. Specified By:The remove () method of LinkedTransferQueue class is specified by:
Return:This method returns a Boolean value true if this queue changed as a result of the call. Example 1Test it NowOutput: Elements in queue : [38, 24, 202, 290, 19] Remaining elements in queue : [38, 24, 202, 290, 19] Example 2Test it NowOutput: Cake Candle Knife Matchbox Cap Stricker New List : [Candle, Knife, Cap, Stricker] Example 3Test it NowOutput: Elements in queue : [27, 49, 190, 72, 42] Next TopicJava LinkedTransferQueue |
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