1. The argument which are passing from command prompt are called command line argument.
2. With the command line argument JVM will create an Array anf by passing that array as argument,JVM with main method.
String[] args = {"a","b","c"}
e.g
java test a b c
args[0] o/p:a
args[1] o/p:c
args.length; o/p:3
sample program:
class Test{
public static void main(String[] args){
int n = Integer.parseInt(args[0]);
system.out.println("the square of number is"+(n*n));
}
}
java Test 5
we get output 25
3. The main objective of command line argument is we can customize behaviour of the main method.
4. Within main method command line argument are available in String type.