Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class NewsPapers {
    public static void main(String args[]) {
        SortedMap paper = new TreeMap();
        paper.put("Hindu", "six");
        paper.put("Eenadu", "seven");
        paper.put("Sakshi", "five");
        paper.put("AndhraJyothi", "three");
        paper.put("Udaya", "four");
        System.out.print(paper.subMap("Eenadu", "Udaya"));
    }
}


{Eenadu=seven, Sakshi=five, AndhraJyothi=three}
{Sakshi=five, AndhraJyothi=three}
{Hindu=six, Sakshi=five, AndhraJyothi=three}
{Sakshi=five, AndhraJyothi=three, Udaya=four}
{Eenadu=seven, Hindu=six, Sakshi=five}
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