Question: Need a quick awnser! Will give good raiting for fast correct awnser. Thank you! Java Class and Inheritance Lab Practice Make a new class called
Need a quick awnser! Will give good raiting for fast correct awnser. Thank you!

Java Class and Inheritance Lab Practice Make a new class called Animal. Animal will have a default constructor that prints to the console "A new animal has been created." Animal will have a function called eat () that will print to the screen, "An animal is eating." Make a new class called Dog that extends Animal Dog will have a default constructor that prints to the console "A new dog has been created." This constructor should call the Animal constructor using super ( ) . Dog will also have the eat () function and it will override the Animal version. Dog's eat () function will print "A dog is eating." There should be no call to the super version of this This class will have an additional function, speak () that will print to the screen "A dog has barked." Make a new class called Puppy that extends Dog Puppy will have a default constructor that prints to the console "A puppy has been created." This constructor should call the Dog constructor using super ) . The eat function for puppy should just be inherited, nothing should change The speak() function should been overwritten for Puppy to print to the screen "A puppy has yipped." Your main function should create a new animal, a new dog, and a new puppy, and then call all of the functions for each object, resulting in a printout that is similar to this A new animal has been created. A new animal has been created. A new dog has been created. A new animal has been created. A new dog has been created. A new puppy has been created. An animal is eating. A dog is eating. A dog has barked. A dog is eating. A puppy has yipped
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
