Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class LastEntry {
    public static void main(String args[]) {
        NavigableMap<Integer, Integer> last = new TreeMap<Integer, Integer>();
        last.put(5, 11);
        last.put(28, 29);
        last.put(5, 27);
        System.out.println(last.lastEntry());
        System.out.print(last.lowerEntry(5));
    }
}


5=27
null
28=29
5=11
5=27
5=11
28=29
null
CompilationError 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