Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Streams {
    public static void main(String args[]) {
        NavigableMap<String, Integer> st = new TreeMap<String, Integer>();
        st.put("velocity", 12);
        st.put("speed", 15);
        st.put("distance", 20);
        st.put("time", 30);
        System.out.println(st.firstEntry());
    }
}


velocity=12
distance=20
time=30
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