Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Sample {
    public static void main(String s[])
    {
        PriorityQueue<String> bk = new PriorityQueue<String>();
        bk.add("paper");
        bk.add("pen");
        bk.add("pencil");
        System.out.println(bk);
    }
}


[pencil]
[]
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java PriorityQueue - PriorityQueue In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App