Basically, it is used for command-line arguments, so if you run :
java MyProgram one two
Then, args will contains ["one","two"]
public static void main(String [] args) {
String one = args[0]; //=="one"
String two = args[1]; //=="two"
}
It will help your application to run in a particular way.
I hope this will help.
Want to become a Java expert? join Java Training now!!
Want to know more about Java? Watch this video on Java Tutorial for Beginners | Java Programming: