Next, I have a ArrayList
of type Student (which is an abstract class), and I have two child classes ( EstudanteGraduacao
and EstudantePosGraduacao
), when I add them to ArrayList
is quiet, but how do I go through it with an object of the daughters?
For example when I do:
for(Estudante e : estudantes){
return e.getX();
// considerando getX um metodo de Estudante
}
It works, the problem is that I do not know how to access the methods of EstudanteGraduacao
...
Anyway, I hope it was clear, I appreciate the help