INHERITANCE AND POLYMORPHISM Write a Java program to create an abstract class Animal with an abstract method called sound(). Create subclasses Lion and Tiger that extend the Animal class and implement the sound() method to make a specific sound for each animal.
INHERITANCE AND POLYMORPHISM Write a Java program to create a class called Animal with a method called makeSound(). Create a subclass called Cat that overrides the makeSound() method to bark.
INHERITANCE AND POLYMORPHISM . Write a Java program to create a class called Vehicle with a method called drive(). Create a subclass called Car that overrides the drive() method to print “Repairing a car”.