Java LinkedTransferQueue isEmpty() methodThe isEmpty() method of LinkedTransferQueue class returns a Boolean value true if the defined queue contains no element. This method overrides the isEmpty() method in class AbstractCollection Syntax:Specified By:The isEmpty() method of LinkedTransferQueue class is specified by isEmpty()method in interface Collection Return:This method returns a Boolean value true if the given queue contains no elements. Example 1Test it NowOutput: Elements are : [1, 2, 3, 4] Example 2Test it NowOutput: isEmpty() method returns true Add some elements because the queue is empty. Example 3Output: Enter three names 1. Name = Jack 2. Name = Harry 3. Name = John Queue : [Jack, Harry, John] 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