Question: You will create a basic java program to implement LightBulb class that represents color light bulb. Different objects (instances) of LightBulb represents different color of
You will create a basic java program to implement LightBulb class that represents color light bulb. Different objects (instances) of LightBulb represents different color of light. Ensure to use package name in the project. Implement few methods on it like switchOn, switchOff, getStatus, getColor switchOn method changes the status of the light bulb as switched on switchOff method changes the status of the light bulb as switched off getStatus method is used to get the current status indicating whether the bulb is ON or OFF. Represent ON by returning TRUE and Represent OFF by returning FALSE Initialize the bulb status with turned OFF i.e. right after a new Object of LightBulb class is created, getStatus should return OFF. getColor method returns the color of the light bulb
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
