What Will Be The Output Of The Following Java Programp Pre #776

What will be the output of the following Java program?</p> <pre><code class="language-java" line="1"> import java.util.*; class Collection_iterators { 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); while(i.hasNext()) System.out.print(i.next() + " "); } }</code></pre>

Online Quiz 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 Iterators - Quiz No.1.


Similar question(s) are as followings:



Online Quizzes of gs128 Java

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background