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,13 @@
package learn.simple_command;
public class Invoker {
private Command slot;
public void setSlot(Command slot) {
this.slot = slot;
}
public void buttonWasPushed() {
slot.execute();
}
}