-
What is the output of this program?
import java.util.*;
public class Map_Example
{
public static void main(String args[])
{
HashMap object = new HashMap();
object.put("I", new Integer(9));
object.put("L", new Integer(12));
object.put("U", new Integer(21));
System.out.println(object.get("L"));
}
}
-
- 9
- 12
- 21
- [I, L, U]
- None of these
Correct Option: B
object.get(“L”) method is used to obtain the value associated with key “L”, which is 12.