MCQOPTIONS
Saved Bookmarks
| 1. |
What is the output of this program?import java.util.*; public class Collection_iterator_Example { public static void main(String args[]) { LinkedList listobject = new LinkedList(); listobject.add(new Integer(10)); listobject.add(new Integer(3)); listobject.add(new Integer(15)); listobject.add(new Integer(12)); Iterator Itr = listobject.iterator(); Collections.reverse(listobject); Collections.shuffle(listobject); Itr.next(); Itr.remove(); while(Itr.hasNext()) System.out.print(Itr.next() + " "); } } |
| A. | 12 10 15 |
| B. | 10 3 15 12 |
| C. | 3 15 12 10 |
| D. | 3 10 12 15 |
| E. | None of these |
| Answer» B. 10 3 15 12 | |