Supplier Functional Interface
Explore the Supplier functional interface in Java 8 to understand how it produces values without input arguments through its get methods. Learn about its primitive versions like IntSupplier and DoubleSupplier, and how to use Supplier<Person> to fetch objects dynamically. This lesson builds foundational knowledge on supplier interfaces in lambda expressions.
We'll cover the following...
We'll cover the following...
Supplier is an interface that does not take in any argument but produces a value when the get() function is invoked. Suppliers are useful when we don’t need to supply any value and obtain a result at the same time.
Below are some of the functional interfaces, which can be categorized as a supplier.
| Interface Name | Description | Abstract Method |
|---|---|---|
Supplier<T> |