Vidyalelo
Java Programming · Q51

Java Collections Framework

Programming · Java Programming · question 51

Q51

What will be the output of the following Java program? import java.util.*; class Maps public static void main(String args[]) HashMap obj = new HashMap(); obj.put("A", new Integer(1)); obj.put("B", new Integer(2)); obj.put("C", new Integer(3)); System.out.println(obj.keySet());

A.
[A, B, C]
Answer
B.
{A, B, C}
C.
{1, 2, 3}
D.
[1, 2, 3]

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board