hi,
public void void main(String[] args )
{
}
in that wt is the use of "(String[] args)"
Printable View
hi,
public void void main(String[] args )
{
}
in that wt is the use of "(String[] args)"
Whatever command line arguments you pass to your program will be in the args String array.
Run the above program with:Code:class CommandLineArgs {
public static void main(String[] args) {
for(int index = 0; index < args; index++) {
System.out.println(args[index]);
}
}
}
java CommandLineArgs one two three apple fig dog