1class CommandLineExample{
2public static void main(String args[]){
3System.out.println("Your first argument is: "+args[0]);
4}
5}
6
7//Now follow these steps
8compile by > javac CommandLineExample.java
9run by > java CommandLineExample sonoo
1public class CommandLine {
2 public static void main(String args[]) {
3 for(int i = 0; i<args.length; i++) {
4 System.out.println("args[" + i + "]: " + args[i]);
5 }
6 }
7}