Loading…
Loading…
Ten exam-style questions on creating Optional with of, ofNullable and empty, unwrapping with get, orElse, orElseGet and orElseThrow, ifPresent, and chaining map, filter, flatMap, or and stream, with explanations.
Practice questions for the article Java Optional: Creating, Checking and Unwrapping Optional Values.
For each call, ask whether the box is empty or full, and what type each lambda must return. Aim for at least 8 out of 10.
Quiz path: step 69. Take the quizzes in this order, after reading each article.
Previous quiz: Chapter 9 Review: Collections and Generics (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.