Len_sprague
0
Q:

java command line arguments

class CommandLineExample{  
public static void main(String args[]){  
System.out.println("Your first argument is: "+args[0]);  
}  
}

//Now follow these steps
compile by > javac CommandLineExample.java  
run by > java CommandLineExample sonoo  
1
public class CommandLine {
   public static void main(String args[]) {
      for(int i = 0; i<args.length; i++) {
         System.out.println("args[" + i + "]: " + args[i]);
      }
   }
}
0

New to Communities?

Join the community