Home / Programming MCQs / JAVA MCQs / Question

P

Pradeep Sikarwar • 9.01K Points
Tutor III

Q. What will be the output of the following code

Code:
import java.util.Map;
import java.util.TreeMap;

public class TreeMapTest {

public static void main (String args[])
{
Map<Integer,String> m= new TreeMap<Integer,String>();
m.put(11, “audi”);
m.put(null, null);
m.put(11,”bmw”);
m.put(null,”fer”);

System.out.println(m.size());
System.out.println(m);
}
}
(A) Runtime exception
(B) Compile time exception
(C) 3
(D) 3.0

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.