1.

What is the output of below snippet?import java.util.*;public class Map_Example{ public static void main(String[] args) { Map mapSample = new TreeMap(); mapSample.put(4, null); mapSample.put(0, null); mapSample.put(3, null); mapSample.put(2, null); mapSample.put(1, null); System.out.println(mapSample); }}

A. {0=null, 1=null, 2=null, 3=null, 4=null}
B. Runtime Error
C. Compilation Error
D. {3=null, 0=null, 2=null, 1=null, 4=null}
E. None of these
Answer» B. Runtime Error


Discussion

No Comment Found

Related MCQs