contestada

The Language is Java. Thank you for your help. 9.3.3
The following Pet class keeps track of a petâs name and type and has a constructor, get method, and a method called speak() that prints an animal noise.
Write a subclass called Dog that inherits from Pet.
Write a Dog constructor that has one argument, the name, and calls the super constructor passing it the name and the animal type "dog".
Override the method speak() in the Dog class to print out a barking sound like "Woof!". (Do not override the get method. This superclass method should work for all subclasses).
Uncomment the Dog object in the main method to test it out.
Write a similar Cat class that inherits from Pet and has a similar constructor and overrides the method speak() with a "Meow!". Test it out.