Question
Define a Mammal interface that has methods speak( ), eat( ), sleep() and mate( ). Then implement classes for Feline, Canine, and Bovine, which implement
Define a Mammal interface that has methods speak( ), eat( ), sleep() and mate( ). Then implement classes for Feline, Canine, and Bovine, which implement this interface, with the obvious meanings for the speak( ), eat( ), sleep() and mate( ) methods.
Also implement classes, Tiger, Lion, Bull, and Wo, which have the appropriate inheritance relationships. Finally, write a simple user interface, which allows users to create animal of the various types, allow them to make sounds, then mate with animals of the same species, and eat other species that are not there own.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started