When I tried to build this program there's always a error like "non-static method referenced from a static context" I think that because I can use "addto" function in "main". So how can I solve this problem? I need a public arraylist because I have to do the calculations in "addto"
Thx!
public class Calculation {
ArrayList<int[]> cal = new ArrayList<>();
public static void main(String[] args) {
System.out.println(addto(3,5));
}
String addto(int figone, int figtwo){
........do the calculations by using arraylist cal
}
}
Calculationin order to invoke the non-static methodaddto