I'm making a program whose basic code is as follows:
public class StatisticalList extends ArrayList {
public double getMinimumValue() {...} public double getMaximumValue() {...} public double range(){ double range = StatisticalList.getMaximumValue() - StatisticalList.getMinimumValue(); return range; }
In this I have implemented two methods, getMinimumValue and getMaximumValue. Next I want to implement a method getRange. It seems easy to not do the calculations again and just call the get__Value() methods.
But this gives an error of The method maxValue() is undefined for the type ArrayList. I want to do this type of calculation where I need to use methods in other methods in my program several times. How do I get this to work?
getMaximumValue()