Question
Consider the following Java code snippet: import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.PriorityQueue; public class HeapQuestion10 { public static void main(String[] args) { List numbers = Arrays.asList(7, 2, 9, 1, 5); PriorityQueue pq = new PriorityQueue<>(numbers); // Initialize with a collection System.out.println(pq.poll()); System.out.println(pq.poll()); System.out.println(pq.poll()); } } What will be the output of this program?
More IT Operating System Questions
- In Operating Systems, what is 'thrashing'?
- A critical section in multithreaded programming is a code segment that:
- The Binary equivalent of the Gray code 1011 will be:
- Which of the attributes shown below is a simple attribute?
- What is the worst-case time complexity for searching an element in an unbalanced Binary Search Tree?
- A subnet uses the mask 255.255.255.192. How many usable host addresses are available per subnet?
- What is the decimal value represented by the 8-bit two's complement binary number 10110101?
- What is the primary purpose of a Service Level Agreement (SLA) in a business context?
- In a switch statement (e.g., C++, Java), what happens if a break statement is omitted from a case block?
- In a RESTful API, which HTTP method is idempotent and is typically used to update or completely replace an existing resource at a specific URI?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)