A

Admin • 802.91K Points
Coach

Q. What is the purpose of the Optional class in Java 8?

  • (A) To represent a value that may be null
  • (B) To represent an empty collection
  • (C) To represent a primitive value
  • (D) To represent a stream of values
  • Correct Answer - Option(A)
  • Views: 6
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
The Optional class provides a way to handle null values without resorting to null checks and exceptions.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.