What will be the output of the following Java program?
import java.util.*;
class Maps
{
public static void main(String args[])
{
TreeMap obj = new TreeMap();
obj.put("A", new Integer(1));
obj.put("B", new Integer(2));
obj.put("C", new Integer(3));
System.out.println(obj.entrySet());
}
}
import java.util.*;
class Maps
{
public static void main(String args[])
{
TreeMap obj = new TreeMap();
obj.put("A", new Integer(1));
obj.put("B", new Integer(2));
obj.put("C", new Integer(3));
System.out.println(obj.entrySet());
}
}
A. [A, B, C]
B. [1, 2, 3]
C. {A=1, B=2, C=3}
D. [A=1, B=2, C=3]
Answer: Option D
Join The Discussion