Iterator: sync post code blocks to repo exactly, Java 25, add H6 file labels and README mapping, fix stale console output
This commit is contained in:
17
README.md
17
README.md
@@ -338,6 +338,23 @@ javac 03-behavioral/command/*.java -d out/command
|
||||
java -cp out/command command.Main
|
||||
```
|
||||
|
||||
### Iterator (`03-behavioral/iterator/`)
|
||||
|
||||
| Post Section | File(s) |
|
||||
|---|---|
|
||||
| Custom Iterator Implementation — the Iterator interface | `BookIterator.java` |
|
||||
| Custom Iterator Implementation — the element type | `Book.java` |
|
||||
| Custom Iterator Implementation — the Aggregate (BookShelf, ForwardIterator, DecadeIterator) | `BookShelf.java` |
|
||||
| Custom Iterator Implementation — wiring it together | `Main.java` |
|
||||
|
||||
Note: the "How Java's For-Each Loop Uses Iterator" snippet (`Iterable<Book>` example) is illustrative only — it is not part of this repository's runnable example.
|
||||
|
||||
Run it:
|
||||
```bash
|
||||
javac 03-behavioral/iterator/*.java -d out/iterator
|
||||
java -cp out/iterator iterator.Main
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- *Design Patterns: Elements of Reusable Object-Oriented Software* — Gamma, Helm, Johnson, Vlissides
|
||||
|
||||
Reference in New Issue
Block a user