Assignment 1
Assignment 1
Then
create derived classes `Dog` and `Cat` that inherit from `Animal`. Override the
`makeSound()` method in each derived class to print the appropriate sound for
each animal. - **Steps:** 1. Create the `Animal` class with a `makeSound()`
method. 2. Create the `Dog` and `Cat` classes that extend `Animal`. 3. Override
the `makeSound()` method in each subclass to print "Woof!" for `Dog` and
"Meow!" for `Cat`. 4. Create a main method to instantiate objects of `Dog` and
`Cat` and call their `makeSound()` methods.
package Assignments;
package Assignments;
class Person {
String name;
int age;
package Assignments;
package Assignments;
package Assignments;