Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public class SimpleRemoteControlTest{
  2. public static void main(String args[]){
  3. SimpleRemoteControl remote = new SimpleRemoteControl();
  4.  
  5. Light light = new Light();
  6. LightOnCommand lightOn = new LightOnCommand(light); //pass the receiver to command
  7.  
  8. remote.setCommand(lightOn); //set command to the slot
  9. remote.buttonWasPressed(); // simulate button press
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement