Exercise 3 (page 1)Create necessary classes to describe this inheritance“Dog”,“Cat” (to be set by children classes) class Animal int age String type Animal() Animal(int age) void setAge(int age) int getAge() int compareTo(Animal o) void talk() class Dog extends Animal Dog() Dog(int age) void talk() class Cat extends Animal Cat() Cat(int age) void talk() Dog says“WUF-WUF” Cat says“MIEW-MIEW”
use“super”
use“super”
Display the type and age of animal