3 ms·
And the whole enumerator/stream now it’s a mess in Java compared to C#. In c# you have IEnumerable that works perfectly with LINQ without using a .stream() meth
by tigershark 8y ago
And the whole enumerator/stream now it’s a mess in Java compared to C#.
In c# you have IEnumerable that works perfectly with LINQ without using a .stream() method call.
You don’t need to collect it explicitly, it will be just “materialised” at iteration time.
If you instead try to pass a stream, even casting it to an enumerator, and it is used twice your software will fail at runtime.
Honestly I can’t imagine how did they manage to over complicate so much Java streams implementation after that Linq was used successfully and in a very elegant way for years...