Question: Write a program in Java that will model a taxonomic hierarchy of animals. Make sure to carefully follow the below requirements for each class. Animal:
Write a program in Java that will model a taxonomic hierarchy of animals. Make sure to carefully follow the below
requirements for each class.
Animal:
Contains instance variables representing name
Implements a default constructor, parameterized constructor taking a string for name, and
getter/setters for name
Implements and overrides the ToString() method to print the animal name
Family:
Inherits from Animal
Contains four instance variables defining a family of mammals
Implements a default constructor, and parameterized constructor for these variables
Implements getters/setters for each instance variable
Implements and overrides the ToString() method to print the animal name, family name, and
call. Separate each of these by spaces
(species):
Do not name this Class Species; rather, come up with two species that would fit into the
same given family
Each species you write must inherit from Family
Implement a default constructor, parameterized constructor, and getters and setters for at least
two variables
Implement and override the ToString() method to print the animal name, family name, call, and
your two instance variables. Separate each by spaces
TaxonomyTester:
Contains only a main method that performs the following:
Instantiate at least three different animals from each of your two species
Call each of their ToString() methods as if they were:
An Animal
A Family
A (species)
Some good examples (that you cannot use in the assignment):
Family: Canine; Species: Wolves
Family: Ursidae; Species: Black Bear
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
