Create an inheritance hierarchy of Rodent: Mouse, Gerbil, Hamster, et…

Previous year question for Java Programming.

Question

Create an inheritance hierarchy of Rodent: Mouse, Gerbil, Hamster, etc. In the base class, provide methods that are common to all Rodents, and override these in the derived classes to perform different behaviors depending on the specific type of Rodent. Create an array of Rodent, fill it with different specific types of Rodents, and call your base-class methods.

Related pages

Open on CachedInfo