0 votes
in Education by (55.6k points)

What is Optional in Java8 in Java8?

1 Answer

0 votes
by (55.6k points)

What is Optional in Java8?

Optional is a container object which is used to contain not-null objects. Optional object is used to represent null with absent value. This class has various utility methods to facilitate code to handle values as 'available' or 'not available' instead of checking null values. It is introduced in Java 8 and is similar to what Optional is in Guava.

...