Command: sync post code blocks to repo exactly, Java 25, split merged commands, add H6 file labels and README mapping

This commit is contained in:
2026-06-24 16:38:35 +05:30
parent 6aaee03ecb
commit 967d490323
2 changed files with 48 additions and 0 deletions

View File

@@ -322,6 +322,22 @@ javac 03-behavioral/chain-of-responsibility/*.java -d out/chain
java -cp out/chain chain.Main
```
### Command (`03-behavioral/command/`)
| Post Section | File(s) |
|---|---|
| Step 1 — Command Interface | `Command.java` |
| Step 2 — The Receiver (TextEditor) | `TextEditor.java` |
| Step 3 — Concrete Commands | `InsertCommand.java`, `DeleteCommand.java` |
| Step 4 — The Invoker (CommandHistory) | `CommandHistory.java` |
| Demo | `Main.java` |
Run it:
```bash
javac 03-behavioral/command/*.java -d out/command
java -cp out/command command.Main
```
## Reference
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides