Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling Arrays from the Cmd Line

Status
Not open for further replies.

brandonstone

Technical User
Sep 15, 2002
2
0
0
US
Hi,

I need to fill an array with integers from the command line, copy the array, and send the copies to two different recursive methods to determing which integer is the largest and which method is the most efficient. I'm able to fill the array (I've got it printing out each element with debugging code), but the values aren't being seen as integers in the array. Therefore, I can't use my other methods to compare the numbers. Any ideas?
 
When you read stuff in form the command line, it is a String object (public static void main (String args[]))

To turn into integers, use

int intOne = Integer.parseInt(args[1]);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top