0 votes
in JAVA by

 Which of the following is true about the Optional class in Java 8?

a) It is used to represent a value that may or may not be present.

b) It is used to represent an empty collection.

c) It is used to represent a nullable object.

d) It is used to represent a default value.

1 Answer

0 votes
by
Answer: a) It is used to represent a value that may or may not be present.

Explanation: The Optional class is used to represent a value that may or may not be present, and provides methods for working with this value.

Related questions

0 votes
asked Apr 13, 2023 in JAVA by Robin
0 votes
0 votes
asked Apr 24 in JAVA by Robin
...