Home / Programming MCQs / JAVA MCQs / Question
U
Q. What will be the output of the following code –
import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.PriorityQueue; public class MyClass { public static void main(String args[]) { PriorityQueue<Integer> q = new PriorityQueue<Integer>(); q.add(1); q.add(2); q.add(3); System.out.println(q.poll()); System.out.println(q.offer(4)); q.add(1); q.remove(2); System.out.println(q.peek()); System.out.println(q); } }
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
The method which is automatically invoked during garbage collection.
How many kinds of classes can be used in Java RMI?
Decrement operator decreases value of variable by what number?
Multiline comment is created using ___.
A Signed 64-bit type is named as
What is the limitation of toString() method of BigDecimal?
Which of the following is the correct syntax for declaring an array of integers in Java?
Discusssion
Login to discuss.