Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Colleges {
    public static void main(String args[]) {
        Map map = new HashMap();
        map.put(1, "KSRM");
        map.put(2, "AITS");
        map.put(3, "Madina");
        Set set = map.entrySet();
        System.out.println("Set mappings are :");
        Map.Entry me = (Map.Entry) set;
        System.out.println(me);
    }
}


[1=KSRM, 2=AITS, 3=Madina]
{1=KSRM, 2=AITS, 3=Madina}
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java HashMap Implementation

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App