What Will Be The Output Of The Following Java Codep Pre #589
What will be the output of the following Java code?</p> <pre><code class="language-java"> import java.util.*; public class list { public static void main(String args[]) { LinkedList l = new LinkedList(); l.add(20); l.add(30); l.add(50); l.add(70); l.add(90); Collections.shuffle(l); System.out.println(l); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs111 OOP Object Oriented Programming Java. It can also be found in gs gs111 Class Components (Using Java) - Memory Allocation - Quiz No.1.
What will be the output of the following Java code?
import java.util.*; public class list { public static void main(String args[]) { LinkedList l = new LinkedList(); l.add(20); l.add(30); l.add(50); l.add(70); l.add(90); Collections.shuffle(l); System.out.println(l); } }
[90, 20, 70, 30, 50]
[90, 30, 20, 50, 70]
[70, 30, 20, 50, 90]
Random order