Campbell Ritchie (63) [Avatar] Offline
#1
Page 212 about ΒΌ way down.
It says s.min() + s.max() is illegal. Is illegal quite the right word?
The code won't compile as is, because the results are Optionals, but adding orElse(0)/orElse(0x7fff_ffff) or similar will allow it to compile. It will run , but crash with a Exception because s.max() cannot be evaluated on a previously used Stream.
Campbell Ritchie (63) [Avatar] Offline
#2
Who chose that avatar for me? It doesn't do me justice; in reality I look far worse than that.
At this stage in the book, are you abbreviating the code? That would explain println() on its own and s.max() rather than s.max().orElse() but it confused me at first.