Question: Please answer correctly and show appropriate codes for the various classes. Outlook 0010:30 PM GitHub, Inc. Animal Consider the Animal class provided. It is an
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
To complete the task well need to override the toString method in the Animal class and implement the Cat and Dog classes by extending Animal Let me gu... View full answer
Get step-by-step solutions from verified subject matter experts
