I have a problem in my code: i have some classes that implements an interface like this:
public interface MyInterface{
puclic void myMethod{...}
}
public class Class1 implements MyInterface{
private int choice1;
private String choice2;
(Override of the other method define in interface)
}
public class Class2 implements MyInterface{
private String choice1;
private int choice2;
(Override of the other method define in interface)
}
These classes are in my model, I would like to ask the view to select individually each of the parameters in these classes and save the choiches from view one to one in the model, but i have to use my controller to verify the input. The problem is that in the controller i don't know the type of the object so i can't call the specific method get or set. Moreover i can't write it in the interface because i have different parameters in Class1 and Class2. So i don't know how to save the choiche from view in the model.