Here is a Java Program to Output the List which contains the Argument from the Command Line
Output of Above Java Program
When This Programs is Executed through the Command Line with Argument as Follows
C:>Java Programs>Java Shuffle Java Programming Language Tutorial
It will Result the Following Output:
[Java,Programming,Language,Tutorial]
import java.util.*; class Shuffle { public static void main(String[] args){ List<String> list = new ArrayList<String>(); for (String a : args) list.add(a); Collections.shuffle(list, new Random()); System.out.println(list); } }
Output of Above Java Program
When This Programs is Executed through the Command Line with Argument as Follows
C:>Java Programs>Java Shuffle Java Programming Language Tutorial
It will Result the Following Output:
[Java,Programming,Language,Tutorial]