Quantcast
Channel: Why should Java 8's Optional not be used in arguments - Stack Overflow
Viewing all articles
Browse latest Browse all 29

Answer by Kieran for Why should Java 8's Optional not be used in arguments

$
0
0

Optionals aren't designed for this purpose, as explained nicely by Brian Goetz.

You can always use @Nullable to denote that a method argument can be null. Using an optional does not really enable you to write your method logic more neatly.


Viewing all articles
Browse latest Browse all 29

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>