Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@manish-r2Hoep • Sep 26, 2010
Basic method of passing command line argument in java is as follow
java <program name> a1 a2 a3 .....
Now for declaration of command line argument we use this statement ,which is must for every java program
public static void main(String args[])
array can be declared as shown below
int a[]=new int[6];
Now since command line argument are in string form you can convert it into integer form by using this
int n=Integer.parseInt(args[0]);
For rest ,i hope you can use your programming skills. 😀 -
@morningdot-6Xuj4M • Sep 26, 2010
Can you post your code so that we can help you.Varsha0802hi.............i want to take an array of integers as input using command line arguments. -
@varsha0802-YohNRX • Oct 8, 2010
thanks..............i got my answer....................