Question: Implement a Java class that represents a light bulb controlled by two switches. This class should have two methods flip1 and flip2 to flip each
Implement a Java class that represents a light bulb controlled by two switches. This class should have two methods flip1 and flip2 to flip each of the two switches. The lightbulb is on if both switches are on or both of them are off. You should provide a third method isLightOn to return whether the lightbulb is on or off. You should define a constructor to initialize switch one as on and switch two as off.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
