I have been struggling with this for several days and would appreciate any insight. Trying to call a method from main that reads string of arguments and determines maximum value. I cannot figure out why the below doesnt work. It appears that when I do the numbers conversion, it doesnt convert it to an array. Thanks,
Use the String array args as the argument to your findMax() method - Done
Then in the findMax() method:
1. Assign the first integer value of the array to a new int, maxValue
2. Compare the other integer values of the array to maxValue, and
a. if a greater value is found, the greater value becomes the new maxValue
3. Repeat step 2 until all array members have been checked.
4. Report maxValue as the largest integer.
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
i don't think you can convert a String array to an Integer (or int) array. You can, however, convert a String to an Int. you can iterate through a String array, converting them one at a time to Integers, then insert those into your Integer array.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors