Return to site

JAVA CERTIFICATION QUESTION: Use the Optional class

· java,ocp

The goal of this quiz is to test your knowledge of the Java Optional class.

Given the class:

What is the output if you run the compiled class as shown below? Choose one.

  • A. A runtime exception
  • B. Blank output
  • C. Java
  • D. default

 

The answer is D.