What will be the output of the following code snippet? class…
What will be the output of the following code snippet? class Animal { void makeSound() { System.out.println(“Animal sound”); } void sleep() { System.out.println(“Animal sleeps”); } } class Dog extends Animal { @Override void makeSound() { System.out.println(“Bark”); } void fetch() { System.out.println(“Dog fetches”); } } public class Main { public static void main(String[] args) { Animal a = new Dog(); a.makeSound(); a.sleep(); } }