Campbell Ritchie wrote:
The variable stream is a notional variable meaning any sort of Stream, irrespective of how you created it. It is of course, a Stream<T>, and the compiler “knows” how to choose all the other generic type parameters for the rest of the Stream's progress.
tangara goh wrote:Note: the oracle's site using map instead of stream() really stumbled me...or is there something I did not comprehend about that part that uses
Campbell Ritchie wrote:But you can't use mapToInt() in the following scenario.
Campbell Ritchie wrote:By the way, read the documentation for reduce() and find out whywon't work correctly.
I fixed it for you. The trick is to replace < and > symbols in your code with HTML entities.
Yes, I did.Mike Simmons wrote:. . . Aside from the fact that String has no "-" operator defined? I guess you meant using the Integer example from before . . .
Popeye has his spinach. I have this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|