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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started