Java LinkedTransferQueue offer() methodThe offer() method of LinkedTransferQueue class is used to add the specified element at the tail of this LinkedTransferQueue. As the queue is unbounded, this method will never return false. Syntax:Specified By:The isEmpty() method of LinkedTransferQueue class is specified by offer in interface BlockingQueue Throws:The offer() method throws NullPointerException - if the defined element(e) holds null value. Return Value:The offer() method returns true on the successful insertion, otherwise returns false. Example 1Test it NowOutput: Queue : [34, 23, 64, 294] Example 2Test it NowOutput: John Harry Kristan Jack Marry 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