โ Back to Inheritance
Question 529
Guitar Overrides Play
Guitar Overrides Play
Instrumenthas avirtualmethodPlaythat returns"silence". OverridePlayinGuitarso it returns"Strum"instead. Do NOT write aMainmethod. AGuitarprints: Strum A plainInstrumentstill prints: silence
Expected Output:
Strum
Topics:
Inheritance
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.