How to access the elements form .length individually ?
Hello Guys, I am struggling with one program. I need to access each one of the elements individually so I can compare them (numbers) and in the end to tell which is the maximum value. If there are 2 maximum values the program should report in which "position" there are in the list. So this is what I got so far and I am stuck of how to tell Java to get the nums individual.
public class BiggestNumber
public static void main(String args)
double number = Double.parseDouble(args);
double maxFoundSoFar = number;
for (int listOfNumbers = 0; listOfNumbers < args.length; listOfNumbers ++)
int restOfNumbers = Integer.parseInt(args[listOfNumbers]);
if (restOfNumbers > maxFoundSoFar) <---- So here how to tell it I want to compare with a num from the lenght ?
Re: How to access the elements form .length individually ?