-
Type:
Sub-task
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: None
-
Component/s: core-libs
-
b84
-
Verified
Optional<T> acts as a container for zero or one non-null values of type T. For methods which may return a value or not (e.g., stream.findFirst()), returning an Optional<T> is more explicit and type-safe. Optional has methods like get() (throws if the value is not present), orElse(T alternate), orElseThrow(Factory<Throwable>), etc.
- relates to
-
JDK-8010690 OptionalDouble.empty().hashCode() doesn't return zero
-
- Closed
-