We have already known that in a java we can pass command line arguments.
Now lets see some minute details about command line arguments using the code snippet below :

(1.1)
public class CommandLineArguments{
public static void main(String args[]){
for(int i=0;i<=args.length;i++){
System.out.println(args[i]);
}
}
}

We shall use java command to run the above program. In order to run this we run :

java CommandLineArguments

One important thing to keep in mind is that java takes all the command line arguments passed and adds them to an array and passes that to the main method.

  1. Passing no parameters
    If we pass no parameters to above command , then when we run the loop nothing shall be printed.
    Reason : Though the array args[] will be created but it will not have any command                     line parameters as none were passed.There will only be args[] of zero                           length.