Java provides a new feature called method reference in Java 8. Method reference is used to refer method of the functional interface. It is a compact and easy form of a lambda expression. Each time when you are using a lambda expression to just referring a method, you can replace your lambda expression with a method reference.
✨ It is shorter than a lambda expression
✨ It includes the name of the class, which contains the method; this improves the readability of the code.
There are four types of method references available
1️⃣ Static Method Reference
2️⃣ Instance Method Reference
3️⃣ Arbitrary object – Instance Method Reference
4️⃣ Constructor Reference
If you want to contact me, you can reach me through below handles.