Saturday, 8 September 2012

Given: 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() + " " ); } | JAVA JSP

     A.    Compilation fails
     B.    one two three four
     C.    four three two one
     D.    four one three two
     E.    one two three four one
     F.    one four three two one
     G.    The print order is not guaranteed.

Ans: D

No comments: