Sync Composite to Java 25: H6 file labels, fix console output typo, README mapping

This commit is contained in:
2026-06-24 14:30:27 +05:30
parent 4091345b20
commit ad6a65a95d
6 changed files with 77 additions and 76 deletions

View File

@@ -215,6 +215,22 @@ javac 02-structural/bridge/*.java -d out/bridge
java -cp out/bridge bridge.Main
```
### Composite (`02-structural/composite/`)
| Post Section | File(s) |
|---|---|
| The Problem: Treating Leaves and Containers Uniformly | illustrative only — not part of this repository's runnable example |
| Step 1 — The Component Interface | `FileSystemItem.java` |
| Step 2 — The Leaf (File) | `File.java` |
| Step 3 — The Composite (Directory) | `Directory.java` |
| Building and Using the Tree | `Main.java` |
Run it:
```bash
javac 02-structural/composite/*.java -d out/composite
java -cp out/composite composite.Main
```
## Reference
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides