class Animal { void makeSound() { System.out.println("Some sound"); } } public class Dog extends Animal { void makeSound() { System.out.println("Bark"); } public static void main(String[] args) { Animal dog = new Dog(); dog.makeSound(); } }