Question: Please answer correctly (sow correct code) for animal and both cat and dog classes Outlook 0010:30 PM GitHub, Inc. Animal Consider the Animal class provided.
Outlook 0010:30 PM GitHub, Inc. Animal Consider the Animal class provided. It is an abstract class to model animals. Read the class and see what it provides. Override Object's tostring) method in the Animal class so that it prints out the animals name and age. Note: assuming your computer's clock is correct, we can get the current year in Java using Java.util.calendar now = java . util.Calenda. int year - now.get (java.util.calendar.YEAR Cat and Dog The cat and Dog classes should extend the animal class. Add any needed constructors and methods to make these work Note: The noise that a cat makes should be meow or prrr (randomly chosen each time it's noise method is called), and the noise a dog makes should be woof or arrrr (randomly chosen each
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
