command line argument

hello everybody...pls help me how to use the command line argument in java...thnks
[89 byte] By [hanamichia] at [2007-11-26 12:40:47]
# 1

Hi,

It is simple. The prototype of main method has the String argument. The arguments from the command will be stored in the string array. By using that String array the programmer can display the things and it can be converted in to other basic data types.

Sample Code:

class s

{

public static void main(String args[])

{

int n,i;

n=args.length();

for(i=0;i<n;i++)

System.out.println(args[i]);

}

}

>

SridharJavaa at 2007-7-7 16:12:50 > top of Java-index,Java Essentials,New To Java...