Question: CSCI 1302 Spring 2021 Problem Specification: 1. Create a class Animal, with following specifications: a Private variable name, you can use any default values b.

CSCI 1302 Spring 2021 Problem Specification: 1. Create a class Animal, with following specifications: a Private variable name, you can use any default values b. Private variable nootlegs, you can use any default values. c. Public method Eat Calling this prints out Eating d. Public method Talk Calling this prints out "Talking e Getter/Setter for name Getter/Setter for nooiLegs 2. Create a class Dog, with following specifications a Extends from Animal Class b. Constructor which takes name as parameter and sets the name of the dog. Set the number of legs to 4 Override method Eat Calling this prints out 'Eating Chimkin nuggeta" d. Override method Talk Calling this prints out "Sark" 3. Create a class Cow, with following specifications # Extends from Animal Class Constructor which takes name as parameter and sets the name of the cow. Set the number of legs to 4 Override method Eat Calling this prints out Chewing grass d Override method Talk Calling this prints out "Moon 4 Write a test program to test the classes o E > Sample outline of the program: public class TestAnimal public static void main(String[] args) { // TODO Auto-generated method stub Animal al - new Animal(): Dog di - new Dog("Dog 1"): Cowal - new Cow ("Cow 1"); al. Eat(); at. Talk dl.Eat() dl. Talk(): ci. Eat(); cl.Taku): 1/ write Animal, Cow and Dog class Sample output: Eating Talking Eating Chinkin noget Chewing grass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
