- Introduced as part of Java 8 and its purpose is to simplify the implementation of Functional Interfaces
- Shortcut for writing Lambda Expressions.
- Refer to a method in a class
ClassName::instance-methodName
ClassName::static-methodName
Instance::methodName
- Lambda expressions referring to a method directly.
Function<String, String> toUpperCaseLambda = (s) -> s.toUpperCase();
Function<String, String> toUpperCaseMethodReference = String::toUpperCase;
In defined logic:
Predicate<Student> predicateUsingLambda = (s) -> s.getGradeLevel() >= 3;