What will be the output of the program? TreeSet map = new TreeSet();…
PYQ RPSC Programmer 2011
What will be the output of the program?
TreeSet map = new TreeSet();
map.add("one");
map.add("two");
map.add("three");
map.add("four");
map.add("one");
Iterator it = map.iterator();
while (it.hasNext() )
{
System.out.print( it.next() + " ");
}
- A.
one two three four
- B.
four three two one
- C.
four one three two
- D.
one two three four one
Sign up free to check your answer
Sign up freeLoading lesson…

