Java examples for Object Oriented Design:main method
Passing Arguments via Command-Line Execution
public class Main { public static void main(String[] args){ if(args.length > 0){ System.out.println("Arguments that were passed to the program: "); for (String arg:args){ System.out.println(arg); }//from ww w . j av a 2s . c o m } else { System.out.println("No arguments passed to the program."); } } }