Well, folks, I have a question about inheritance, for example:
List<Carros> carros = new ArrayList<>();
Chevete chevete = new Chevete();
chevete.acelerarMuito(); //Até aqui ok
carros.add(chevete);//Adicionando chevete numa lista de carros
carros.get(0).??? //Não consigo mais usar o método acelerar
How to proceed? My intention is to have a List with inherited objects, but I need to use the specific methods of each one by accessing .get (index)
I do not want to create a List for each car model. Suppose the accelerate method is only present in the chevete, so I did not create it in the Car class.