Java ArrayBlockingQueue remove() MethodThe remove() method of ArrayBlockingQueue class removes the specified element from the queue, if that element is present in the queue. Syntax:Parameters:The parameter 'o' is passed which is removed from the queue, if the element is present. Specified By:The remove () method of ArrayBlockingQueue class is specified by:
Return Value:The remove() method returns a Boolean value corresponding to this Object 'o':
Example 1Output: Elements in queue : [12, 98, 122, 102, 112] Remaining elements in queue : [12, 98, 112] Example 2Output: Cake Pulses Sugar Salt Basmati Rice Aata New List : [Pulses, Sugar, Basmati Rice, Aata] Next TopicJava-arrayblockingqueue-removeif-method |
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