(Choose 1 answer)
A. {1=null, 2=null, 3=null, 4-null, 5=null}
B. (5=null, 4-null, 3=null, 2=null, 1=null}
C. Exception is thrown
D. {1=null, 5=null, 3=null, 2=null, 4=null}
}
}
What will be the output of the following Java program?public class Demo
public static void main(String[] args)
{
Map<Integer, Object> sampleMap = new TreeMap<Integer, Object>();
sampleMap.put(1, null);
sampleMap.put(5, null);sampleMap.put(3, null);
sampleMap.put(2, null);
sampleMap.put(4, null);
System.out.println(sampleMap);