Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class Geometry {
    public static void main(String args[]) {
        Map<Integer, String> map = new HashMap<Integer, String>();
        map.put(1, "circle");
        map.put(2, "eclipse");
        map.put(3, "parabola");
        String k2 = map.get(1);
        boolean key = map.containsValue(k2);
        System.out.print(key);
    }
}


false
true
Some other output
Compilation Error or 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