Loading

Quipoin Menu

Learn • Practice • Grow

java / Java Polymorphism
exercise

Exercise Number: 1

Q. Create a class Animal with a method sound(). Then create subclasses Dog and Cat that override the sound() method to provide their own implementation. Demonstrate polymorphism by calling sound() on the objects of Dog and Cat.