Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Cities {
    public static void main(String args[]) {
        NavigableMap nv = new TreeMap();
        nv.put("Hyderabad", 1);
        nv.put("Banglore", 3);
        nv.put("Pune", 5);
        System.out.print(nv.descendingKeySet());
    }
}


[Pune, Hyderabad, Banglore]
[Banglore, Hyderabad, Pune]
[Pune, Banglore, Hyderabad]
Compilation Error or Runtime Error

Doubts

Problems

Topic: TreeMap In Java - java.util.TreeMap

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App