A

Admin • 832.70K Points
Coach

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
  • Correct Answer - Option(A)
  • Views: 23
  • Filed under category Java
  • Hashtags:

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.

Be the first to start discuss.