5 ms·
The big advantage of the functional style in Java is that you are disallowed at the compiler level from modifying the contents of the collection you're iteratin
by entropicdrifter 5y ago
The big advantage of the functional style in Java is that you are disallowed at the compiler level from modifying the contents of the collection you're iterating over. That sort of compiler-enforced good practice is definitely for the best.
- dehrmann 5y ago> you are disallowed at the compiler level from modifying the contents of the collection you're iterating over This fails at runtime, not compile time for me: x.forEach(i -> x.add("a"));