Animal Kingdom
EasyCreate a base Animal class with methods eat() and sleep().
Subclasses: Mammal, Bird, Fish with specific behaviors (e.g., Bird can fly()).
Use polymorphism to make all animals perform a daily routine.
OOP Focus: Method overriding.
Note: This is statement-only in the current Practice version; stdout should be empty.
Loading editor...
Output
Run or submit to see output.