Having been using Java 8 now for 6+ months or so, I\'m pretty happy with the new API changes. One area I\'m still not confident in is when to use Optional
. I se
Seems Optional
is only useful if the type T in Optional is a primitive type like int
, long
, char
, etc. For "real" classes, it does not make sense to me as you can use a null
value anyway.
I think it was taken from here (or from another similar language concept).
Nullable
In C# this Nullable
was introduced long ago to wrap value types.