First Day with Java and I am getting an error in the for loop when I add the array index to the variable minIndex. I'm not sure exactly what to put in as the value in the (). I tried i but that didn't work and with my lack of knowledge in java, I am unsure. May I have some guidance please.
public static int minPosition(double[] list) {
double leastNum;
leastNum = list[0];
// leastNum starts at first number in array
int minIndex;
minIndex = 1;
// minIndex starts at 1 as if first number in Array happens to be the lowest, its index will be one
for ( int i = 0; i < list.length; i++)
if (list[i] < leastNum)
leastNum = list[i];
minIndex = list.indexof(i);
return minIndex;