You titled the thread "recursion", but didn't say whether you wanted to use it and I do not see your attempt at it. You also call a method
findLargest, so I don't understand why you need the
tester methods. The following compiles and runs - but I'm leaving the
findLargest logic up to you - if you get stuck post how you've attempted it.
Please use code tags.
public class ArrayTools {
double[] doubs = new double[100];
double maximum;
public ArrayTools(double[] myArray) {
this.doubs = myArray;
}
public boolean tester() {
return true;
}
private boolean tester(double i, int j) {
return true;
}
public double findLargest() {
// for all values k in doubs,
// iterate over doubs[k],
// compare next value to values already compared
return maximum;
}
}
public class ArrayToolsTest{
public static void main(String[] args) {
double[] myArray = { 1.2, 5.7, 4.3, 17.24, 12.34 }; // Fill this array with any doubles
ArrayTools tester = new ArrayTools(myArray);
System.out.println("The largest value in the array is " + tester.findLargest());
}
}