Question: (WRITE A PROGRAM IN JAVA). Please make sure you include; chewCud and grazes methods. GrazingMammals.java In this project you will learn about abstract classes. inheritance,

(WRITE A PROGRAM IN JAVA).

Please make sure you include; chewCud and grazes methods.

(WRITE A PROGRAM IN JAVA). Please make sure you include; chewCud and

grazes methods. GrazingMammals.java In this project you will learn about abstract classes.inheritance, and interfaces in Java. You also may learn something about farmanimals that you may not have known before. You will, however, NOTbe tested about farm animals. But you Do need to learn about GrazingMammals.java

inheritance and interfaces. We will model three grazing farm animals, namely Cows,

In this project you will learn about abstract classes. inheritance, and interfaces in Java. You also may learn something about farm animals that you may not have known before. You will, however, NOT be tested about farm animals. But you Do need to learn about inheritance and interfaces. We will model three grazing farm animals, namely Cows, Goats, and Horses. All of these animals are mammals. They are also all grazing mammals. But of course, all Mammals do not graze. For example, although I believe most of my students are mammals, I am not sure about all of their eating habits. A few more facts about farm animals: Ruminants are a particular type of grazing mammal, in that Ruminants chew cud. They also have multiple stomachs for digesting their forage. Cows and goats have multiple stomachs and chew cud. Horses graze but are not ruminants and do not chew cud and do not have multiple stomachs. The concepts of Mammal, Grazing Mammal, and Ruminant are abstractions, that is, these words are conceptual constructs. You cannot go to a farm animal auction or Amazon and buy a Ruminant. If you ask for one, the seller will ask you what kind? You must buy an actual, concrete, non-abstract animal such as a cow.goat, or horse. For this reason, if we model Mammal, GrazingMammal, and Ruminant classes in Java, these classes are declared as abstract and cannot be instantiated (just like a ruminant cannot be born or bought). However, the characteristics and behavior of mammals, grazing mammals, and ruminants can be inherited by their descendants, as shown below. Your job is to implement the following class design: Cabstract>Mammal void nurses Youngo extends Cabstract GrazingMammal void grazes() implements cinterface> Ruminant Tester void testif Ruminant void testHasMultiple Stomachs() extends Mammal void nurses Youngo extends Cabstract GrazingMammal void grazes() implements cinterface> Ruminant Tester void testif Ruminant void testHasMultiple Stomachs() extends

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!