M

Mr. Dubey • 53.48K Points
Coach

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());

}
}

}
  • (A) 0 null
  • (B) 1 null
  • (C) 2 null
  • (D) 11 44
  • Correct Answer - Option(C)
  • Views: 129
  • Filed under category JAVA

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.


Question analytics