โ Back to Inheritance
Question 519
Override A Property
Override A Property
Properties can bevirtualand overridden just like methods.Employeehas avirtualread-only propertyRolewhose getter returnsEmployee. OverrideRoleinManagerso its getter returnsManager. Do NOT write aMainmethod. When the tester stores aManagerin anEmployeevariable and printsRole, the program prints: Manager
Expected Output:
Manager
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.