CJCoding With Joseph
15free / daySign inCreate account

A base class Animal is provided with a name field and a speak() method that returns "...". Complete the Dog class so it extends Animal.

Requirements: 1. Call the parent constructor with the given name using super(). 2. Override speak() to return "Woof".

Do NOT write a main method. Your class will be tested by a hidden Main class.

Expected output

Buddy
Woof

= newline. The output ends with a newline, so print one after the last line.

Hints2 available
Topics
InheritanceClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.