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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!