โ Back to Polymorphism
Question 584
Override a Void Method
Override a Void Method
Overriding also works for methods that return nothing. TheLoggerclass has avirtual void Log(string)that printsLOG: <msg>. OverrideLoginErrorLoggerso it printsERROR: <msg>instead. Do NOT write aMainmethod. For the messagedisk full, the program prints: ERROR: disk full
Expected Output:
ERROR: disk full
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.