Question: All Animal objects have the following attributes. A String variable indicating whether the animal is a carnivore or a herbivore A String variable representing the
All Animal objects have the following attributes.
A String variable indicating whether the animal is a carnivore or a herbivore
A String variable representing the animal species eg lion, giraffe, zebra
A String variable representing the name of the individual animal eg Lisa, Gary, Percy
The Animal class also contains a toString method that indicates the state of an animal.
The following table shows the intended behavior of the Animal class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
