Answers for "list shuffle java"

0

list shuffle java

import java.util.*;

public class List{
   
    public static void main(String[] args){
        LinkedList<Integer> ListOfNumbers = new LinkedList<Integer>();
        ListOfNumbers.add(1);
        ListOfNumbers.add(2);
        ListOfNumbers.add(3);
        ListOfNumbers.add(4);
        ListOfNumbers.add(5);
        System.out.println("The Original Sequence of numbers was : \n" + ListOfNumbers);
        Collections.shuffle(ListOfNumbers);
        System.out.println("\n The shuffled list is : \n" +ListOfNumbers );
    }
}
Posted by: Guest on March-18-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language