2 ms·
Java Optionals are useful in Streams. I've found I agree with the principle that Optionals only make sense for return values (and if the method returns null, t
by heurisko 5y ago
Java Optionals are useful in Streams.
I've found I agree with the principle that Optionals only make sense for return values (and if the method returns null, that should be treated as a bug).
I've seen Optionals used for member variables, and they might as well just be null. (And are highlighted as such by IDEs like IntelliJ).