πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) Runtime exception

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
272
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Pradeep Sikarwar
Publisher
πŸ“ˆ
99%
Success Rate