Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Courses {
    public static void main(String args[]) {
        NavigableMap<String, Integer> course = new TreeMap<String, Integer>();
        course.put("Java", 8);
        course.put("Oracle", 7);
        course.put("Teradata", 6);
        course.put("Sql", 5);
        System.out.println("Value is: " + course.navigableKeySet());
    }
}


Value is: [Java, Oracle, Teradata,Sql
Value is: [8, 7, 6, 5]
Value is: [Java, Oracle, Sql, Teradata]
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