Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class WorldMap {
    public static void main(String args[]) {
        NavigableMap<Integer, String> wm = new TreeMap<Integer, String>();
        wm.put(10, "Countries");
        wm.put(28, "States");
        wm.put(29, "Districts");
        System.out.println(wm.higherEntry(9));
        System.out.print(wm.higherEntry(30));
    }
}


10=Countries
null
null
29=Districts
10=Countries
29=Districts
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