Question: public class DimmableFloorLamp extends FloorLamp implements Dimmable { public void turnOff() { System.out.print(Dimmable Off: ); } public void turnOn(){ System.out.print(Dimmable On: ); } public void

public class DimmableFloorLamp extends FloorLamp implements Dimmable \{ public void turnOff() \{ System.out.print("Dimmable Off: "); \} public void turnOn()\{ System.out.print("Dimmable On: "); \} public void setTo(int value) System.out.print("Dimmable DimVal:" + value +":"); \} Consider this instantiation code: Room r= new Room(); Lamp p = new FloorLamp (); r.setLamp(p); r. turnLighton(); r.turnLight0ff(); Will it compile, and if yes, what will it print? a. Lamp On: Dimmable Off: b. Runtime Error c. Lamp On: Floor Off: d. Dimmable On: Floor Off: e. Compilation Error
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
