Java Command line arguments

    Command-line arguments

    These are the arguments that are passed to the java program when you are running them from the command prompt. These arguments can be used as an input for the program to act upon. In this way, you can test the same program with different input values from the command prompt.

    Example-

    For the below example, we should at least pass one argument.

    class Simple{  
            public static void main(String args[]){  
            System.out.println("Your first argument is: "+args[0]);  
       }  
    }