โ Back to Interfaces
Question 630
Implement Several Interface Methods
Implement Several Interface Methods
TheILightinterface has aIsOnproperty andTurnOn/TurnOffmethods. TheLampclass already hasIsOn. CompleteTurnOnandTurnOffso they setIsOntotrueandfalse. The tester turns the lamp on, printsIsOn, turns it off, and prints again. Do NOT write aMainmethod. Remember thatConsole.WriteLineprints a bool asTrueorFalse. The program prints: True False
Expected Output:
True False
Topics:
Interfaces
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.