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
Be the first to start discuss.
Q. Which of these method is called when http daemon is acting like a normal web server?
Q. If you access an uninitialized local variable will result?
Q. What will be the output of the following Java program?
Q. A "this" operator used inside a Java method refers to ___ variable.
Q. What is the output for the below code ?
Q. Variable declared as _________ do not occupy memory on a per instance basis.
Q. Iterator returned by LinkedHashMap on key, value and entry is?
Q. Integer Data type does not include following primitive data type
Discusssion
Login to discuss.