Have you tried a score of 101?Martin Gerard wrote:I think that using below would cause the evaluation to always be true. . . .
That method returns an Integer object irrespective of the generics and its declared return type, and is therefore written incorrectly. The client is not misusing that method at all. All the blame should fall on line 7.Tapio Niemela wrote:. . . if it is "misused" by the client (expecting giveMeNumber to return Long). Of course, such method should not exist in the first place, to be "misused" by the client.
That's a pleasure. . . I'm grateful . . .
Of course they are. sorryStephan van Hulst wrote:I think those commands are wrong Campbell. . . .
No, you changed it completely with that generic method.Tapio Niemela wrote:. . . rather complicated case which I oversimplified with my example . . .
Hehner, whom I mentioned last night, is firmly of the iinclusive...jexclusive school, and you can see the designers of IntStream#range() thought the same way. Fortunately, they named the parameters in the documentation to make that easier to understand.Junilu Lacar wrote:. . . Kotlin, where x in 1..max is means 1 <= x <= max . . .
I like takeWhile() and its brother, both methods missed out when Streams appeared in Java8. I was pleased to see them, added as necessary enhancements in Java9. They allow us to start or stop reading from a sentinel value,, and both have counterparts in the other kinds of Stream.Mike Simmons wrote:. . . . . .