Overload an Inherited Method in a Subclass
easyQuestion 516Overloading means two methods share a name but take different parameters. FormalGreeter inherits greet() with no parameters from Greeter, and adds a second greet that takes a name. The inherited one is not replaced: both can be called on a FormalGreeter. Complete the overload.
Requirements:
1. greet(String name) returns the text of the inherited greet(), then a comma and a space, then name. With the name Sam that gives Hello, Sam.
2. Get the first part by calling greet() with no arguments. Do not type the word Hello yourself: a test changes what greet() returns and expects your method to follow it.
The Greeter class is provided. Do not change it.
Do NOT write a main method.
Expected output
Hello Hello, Sam Hello, Dr. Lee
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...