Is it possible to store void type methods in an arrayList or can you only store methods that have a return value? I want to call any one of up to 15 methods and rather than write:
if(var == 1){
method1()
}else if(var ==2){
method2();
}
etc...
by the time you surround with try/catch and a few more lines of code (that repeat for each one) it would be much neater if you could do:
arrayList.get(var); //or something similar
However my methods just "do stuff" as opposed to return a value so if the methods themselves cannot be stored in an array is there somewhere else they can be stored together and extracted with a for loop or by just using the "var" integer?