Java PriorityQueue contains() MethodThe contains() method of PriorityQueue class returns true if the specified element is present in this queue. SyntaxParametero - It is the object that is to be checked for occurrence in this queue. Specified ByThe contains() method of PriorityQueue class is specified by contains() method in interface Collection<E> OverrideThe contains() method of class PriorityQueue is overrided by contains() method in class AbstractCollection. Return ValueThe contains() method returns true if the specified element is present in this queue. Example 1Output: Mira Rajesh Ram Sham Ram is present Example 2Output: Q. Enter a prime no btw 1-10. Ans 6 Incorrect answer! Next TopicJava-priorityqueue-iterator-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