MCPcopy Create free account
hub / github.com/Anchals24/Low-Level-Design / Main

Class Main

CommandDesignPattern/WithCommandDesignPattern/Main.java:7–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import BehaviouralDesignPatterns.CommandDesignPattern.WithoutCommandDesignPattern.AirConditioner;
6
7public class Main {
8 public static void main(String[] args) {
9 //AC Object
10
11 AirConditioner AC = new AirConditioner();
12
13
14 //RemoteControl
15
16 MyRemoteControl remoteObj = new MyRemoteControl();
17
18 //create the command & press the button
19 remoteObj.setCommand(new TurnACOnCommandImpl(AC));
20
21 //users job is just to press the button.
22
23 remoteObj.pressButton();
24
25 //undo the command
26
27 remoteObj.undo();
28
29 }
30
31
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected