class Animal { public void makeSound() { System.out.println("som generico"); } }
class Cachorro extends Animal {
@Override
public void makeSound() {
System.out.println("gritar");
}
}
public class Main {
public static void main(String[] args) {
Cachorro cachorro = new Cachorro();
Animal animal = (Animal) cachorro;
animal.makeSound();
}
}