-
What is the output of this program?
import java.util.*;
public class Map_Exmple
{
public static void main(String args[])
{
TreeMap object = new TreeMap();
object.put("I", new Integer(9));
object.put("L", new Integer(12));
object.put("U", new Integer(21));
System.out.println(object.entrySet());
}
}
-
- 9, 12, 21
- I, L, U
- [9, 12, 21]
- [I=9, L=12, U=21]
- None of these
Correct Option: D
object.entrySet() method is used to obtain a set that contains the entries in the map. This method provides set view of the invoking map.