Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Colours {
    public static void main(String args[]) {
        NavigableMap clr = new TreeMap();
        clr.put(4, "red");
        clr.put(6, "blue");
        clr.put(8, "white");
        clr.put(10, "green");
        System.out.println(clr.ceilingEntry(5));
        System.out.println(clr.ceilingEntry(7));
    }
}


6=blue
6=blue
4=red
6=white
6=blue
8=white
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