What is the output of the following program?
import java.util.*;
class Question {
public static void main(
String[] args) {
TreeMap map = new TreeMap();
map.put("one","1");
map.put("two","2");
map.put("three","3");
display(map);
}
static void display(TreeMap map) {
Collection c = map.entrySet();
Iterator i = c.iterator();
while(i.hasNext()) {
Object o = i.next();
System.out.print(o.toString());
}
}
}
A)123
B)onetwothree
C)one=1three=3two=2
when i run i get c as the answer
but I did'nt understand how it came ..explain please