Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › Optional.html
Optional (Java Platform SE 8 )
April 21, 2026 - public final class Optional<T> extends Object · A container object which may or may not contain a non-null value. If a value is present, isPresent() will return true and get() will return the value.
Videos
23:31
Java 8 Optional Class Deep Dive | isPresent(), ifPresent(), orElse(), ...
16:27
What is Optional In Java 8 With Practical Implementation | Optional ...
11:35
Java 8 Optional | isPresent | of | empty | Episode 2 | Java Tutorial ...
01:11
Day-62: How isPresent() method of Optional work in Java #shorts ...
Using the different methods of Optional - isEmpty(), ifPresent ...
15:30
Java Optional Complete Guide - YouTube
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › util › Optional.html
Optional (Java SE 11 & JDK 11 )
January 20, 2026 - public final class Optional<T> extends Object · A container object which may or may not contain a non-null value. If a value is present, isPresent() returns true. If no value is present, the object is considered empty and isPresent() returns false.
Java67
java67.com › 2018 › 06 › java-8-optional-example-ispresent-orElse-get.html
Java 8 Optional isPresent(), OrElse() and get() Examples | Java67
package tool; import java.util.Arrays; import java.util.List; import java.util.Optional; /** * Program to demonstrate how to use Optional in Java 8 * * @author WINDOWS 8 * */ public class Hello { private static List<String> listOfBooks = Arrays.asList("Effective Java", "Clean Code", "Test Driven"); /* * Return the first book start with a letter. */ public static String getBook(String letter) { Optional<String> book = listOfBooks.stream() .filter(b -> b.startsWith(letter)) .findFirst(); return book.isPresent() ?
GeeksforGeeks
geeksforgeeks.org › optional-ispresent-method-in-java-with-examples
Optional isPresent() method in Java with examples | GeeksforGeeks
July 30, 2019 - The isPresent() method of java.util.Optional class in Java is used to find out if there is a value present in this Optional instance.
Oracle
docs.oracle.com › en › java › javase › 16 › docs › api › java.base › java › util › Optional.html
Optional (Java SE 16 & JDK 16)
January 6, 2022 - public final class Optional<T> extends Object · A container object which may or may not contain a non-null value. If a value is present, isPresent() returns true. If no value is present, the object is considered empty and isPresent() returns false.
Apps Developer Blog
appsdeveloperblog.com › home › java › functional programming in java › optional – ifpresent() and ispresent() methods
Optional - ifPresent() and isPresent() methods - Apps Developer Blog
August 10, 2022 - The isPresent() method returns true if there is a value present in the Optional, otherwise false. Using it, we can avoid getting an exception when trying to get the value from an empty Optional.
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.base › java › util › Optional.html
Optional (Java SE 21 & JDK 21)
January 20, 2026 - public final class Optional<T> extends Object · A container object which may or may not contain a non-null value. If a value is present, isPresent() returns true. If no value is present, the object is considered empty and isPresent() returns false.
Educative
educative.io › answers › what-is-the-optionalispresent-method-in-java
What is the Optional.isPresent method in Java?
In Java, the Optional object is a container object that may or may not contain a value. Using the Optional object’s isPresent method, we can replace the multiple null check.
Globalmentor
globalmentor.com › courses › softdev › optionals
Optionals
When using Optional<T> you can avoid a NoSuchElementException as you would avoid a NullPointerException: by first checking if a value is present before continuing processing. The Optional.isPresent() method indicates whether the Optional<T> instance contains a value, and can be used wherever ...
GeeksforGeeks
geeksforgeeks.org › java › optional-class-ispresent-function
Optional Class | isPresent() function - GeeksforGeeks
February 22, 2018 - The isPresent() function in Optional Class is used to evaluate whether the value if assigned to variable is present or not.
Oracle
docs.oracle.com › javase › 9 › docs › api › java › util › Optional.html
Optional (Java SE 9 & JDK 9 )
If a value is present, isPresent() returns true and get() returns the value. Additional methods that depend on the presence or absence of a contained value are provided, such as orElse() (returns a default value if no value is present) and ifPresent() (performs an action if a value is present).
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › util › Optional.html
Optional (Java SE 17 & JDK 17)
April 21, 2026 - public final class Optional<T> extends Object · A container object which may or may not contain a non-null value. If a value is present, isPresent() returns true. If no value is present, the object is considered empty and isPresent() returns false.