added command pattern example

This commit is contained in:
2024-10-13 18:22:53 +02:00
parent 7c3d0b2cbd
commit 3a2484a123
5 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
package learn.simple_command;
public class ConcreteCommand implements Command {
private Receiver receiver;
public ConcreteCommand(Receiver receiver) {
this.receiver = receiver;
}
@Override
public void execute() {
receiver.action();
}
}