27
May

for one args I do the following

static public void main(String args[]) {

long x = Long.parseLong(args[0]); ……

how would I do a similar but having two separate inputs?

Thanks!


Answer:
long x = Long.parseLong(args[0]);//for first input

long y= Long.parseLong(args[1]);//for 2nd input

and this is when both the inputs are command line inputs…. that’s u give the inputs when beginning the programs execution.

Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList

This entry was posted on Tuesday, May 27th, 2008 at 2:12 am and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or TrackBack URI from your own site.

Leave a reply

Name (*)
Mail (*)
URI
Comment