The parameters which are provided to the program at the command line.
Eg:d:\>java a 10 20 30
Here,“java” is an interpreter, “a” is filename,10,20,30 are arguments passed to the program while executing the program
And the notation of String args[] in main method will be cleared with the command line arguments.
public static void main(String[] args)
The “String[]args” declares args as an array of strings. Args by default holds the strings given to the program while executing it.
class CommandMadeEasy
{
public static void main(String args[])
{
System.out.println(args[0]);//holds the first string
System.out.println(args[1]);//holds the second string
System.out.println(args[2]);//holds the third string
} }
Output :
welcome
to
cse