# Java 9: Updates to Optional

DevFeed: [Java 9: Updates to Optional](<https://devfeed.tech/articles/java-9-updates-to-optional-21500.md>)

Original publisher: [Read original article](<https://mirocupak.com/java-9-updates-to-optional/>)

Published: 2017-11-11T17:25:19Z

Content type: tutorial

Language: en

Sources: [Miro Cupak](<https://devfeed.tech/sources/miro-cupak.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Streams](<https://devfeed.tech/topics/streams.md>)

Tags: [java](<https://devfeed.tech/tags/java.md>), [java-9](<https://devfeed.tech/tags/java-9.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [streams](<https://devfeed.tech/tags/streams.md>), [updates](<https://devfeed.tech/tags/updates.md>)

## AI overview

A tutorial on Java 9 updates to Optional. It explains the methods added in JDK 9 for handling absent values, including actions for empty values, supplying fallback Optionals, unwrapping values, and converting an Optional to a stream.

## Source excerpt

In the previous post in this series, we examined features of the Stream API added in Java 9. A very useful API that plays well with streams, and was, in fact, used to make streams more robust, is Optional. Let's explore it with JShell! Optional provides a container that may or may not contain a...