Class SupplierExample
java.lang.Object
modernfeatures.lambda.builtinfunctionsdemo.SupplierExample
Demonstrates the use of the built-in functional interface
Supplier<T>
.
Supplier<T>
represents a supplier of results.- No input argument; returns a value of type
T
. - Key method to implement:
get()
.
Example usage:
Supplier<String> s = () -> "Hello"; System.out.println(s.get());
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SupplierExample
public SupplierExample()
-
-
Method Details
-
main
-