Java examples for Object Oriented Design:main method
Processing Command-line Arguments Inside the main() Method
public class Main { public static void main(String[] args) { // args contains all command-line arguments System.out.println("Total Arguments:" + args.length); /*from www. java2 s . co m*/ // Display all arguments for(int i = 0 ; i < args.length; i++) { System.out.println("Argument #" + (i+1) + ":" + args[i]); } } }