A Simple program in JAVA to pass arguments to the program from the command line.

Posted by Abhisek under Others category on | Views : 1808
class Command
public static void main(String args[])
int i;

First compile the program.
Then run the program by passing a string. It will display the string you passed as the output

Ex- java Command I am Abhisek

Here in the above example "I am Abhisek" is the string passed at the command line. So the output will be I am Abhisek .

Comments or Responses

Login to post response