l
- A Java application can accept any number of arguments from the command-line.
- Command-line arguments allow the user to affect the operation of an application.
- The user enters command-line arguments when invoking the application and specifies them after the name of the class to run.
- In Java, when you invoke an application, the runtime system passes the command-line arguments to the application's main method via an array of Strings.
public static void main( String[] args )
Each String in the array contains one of the command-line argumentsExample:1public class CommandLineSample2{3 public static void main( String[] args ){45 for(int i=0; i6 System.out.println( args[i] );7 }89 }10}
good work u did it man .Its really fine for beginners
ReplyDelete