What Will Be The Output Of The Following Java Programp Pre #803
What will be the output of the following Java program?</p> <pre><code class="language-java" line="1"> import java.util.*; class Collection_Algos { public static void main(String args[]) { LinkedList list = new LinkedList(); list.add(new Integer(2)); list.add(new Integer(8)); list.add(new Integer(5)); list.add(new Integer(1)); Iterator i = list.iterator(); Collections.reverse(list); Collections.shuffle(list); while(i.hasNext()) System.out.print(i.next() + " "); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Util Collections Framework - Java Collections Interface - Quiz No.1.