โ Back to Polymorphism
Question 577
Extend the Base Method with base
Extend the Base Method with base
The base classGreeterhas avirtualmethodGreet()that returnsHello. OverrideGreet()inFriendlyGreeterso it returns the base greeting followed by, friend. Usebase.Greet()to reuse the base result instead of retypingHello. Do NOT write aMainmethod. The program prints: Hello, friend
Expected Output:
Hello, friend
Topics:
Polymorphism
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.