Q. What will be the output of the following code –
Code:
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentSkipListMap;
public class ConcurrentSkipMapTest {
public static void main (String args[])
{
Map<Integer,String> concurrentSkipListMap= new ConcurrentSkipListMap<Integer,String>();
concurrentSkipListMap.put(11,”audi”);
concurrentSkipListMap.put(44,”null”);
Iterator<Integer> keyIterator = concurrentSkipListMap.keySet().iterator();
while (keyIterator.hasNext())
{
System.out.print(keyIterator.next());
}
}
}
β
Correct Answer: (C)
2 null