class Command
{
public static void main(String args[])
{
int i;
for(i=0;i<args.length;i++)
System.out.println(args[i]);
}
}
First compile the program.
Then run the program by passing a string. It will display the string you passed as the output
Ex- java Command I am Abhisek
Here in the above example "I am Abhisek" is the string passed at the command line. So the output will be
I am Abhisek .