Saturday, May 30, 2015

CommandLine Args


// A command-line argument is the information that directly follows the program's name on the command line when it
// is executed. To access the command-line arguments inside a Java program is quite easy.they are stored as strings
// in the String array passed to main( ).

// Pass the args by right click to project folder , debug as , debug config.. , argument tab ,and pass the value
// saperated by space awe aweso awesome

public class ClassA {

public static void main(String[] args) {
for (int i = 0; i < args.length; i++) {
System.out.println("index"+i+" - "+args[i]);
}
}
}


No comments:

Post a Comment