โ Back to Inheritance
Question 540
Shadow A Method With new
Shadow A Method With new
Loggerhas aLogmethod returning"base log". InFileLogger, hide it with a newLogmethod (using thenewkeyword) that returns"file log". The tester callsLogthrough aFileLoggerreference and then through aLoggerreference. Do NOT write aMainmethod. The program prints: file log base log
Expected Output:
file log base log
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.