I’m guessing it’s the line Program.setInventorie(c1);
. You need to create an instance of the Program
class and call setInventorie()
on that. setInventorie()
is not a static method.
e.g.:
Program myProgram = new Program();
myProgram.setInventorie(c1);
7
solved Arraylist for subclasses [duplicate]