Software >> Development >> Languages >> Java >> Examples >> How to parse the command line arguments

cmdline.java ============ class cmdline { public static void main(String args[]) { for(int i=0;i<args.length;i ) System.out.println("args[" i "]: " args[i]); } } compile ======= javac -classpath . cmdline.java run === java -classpath cmdline par1 par2 par3 ...