Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shubh2-0/method-references

The method reference is nothing but the simplified version of the lambda expression. Instead of providing an implementation body, a method reference refers to an existing available method
https://github.com/shubh2-0/method-references

consumer-functional-interface function-functional-interface functional-programming java java-8 lambda-functions method-reference predicate-functions sts4 supplier-functional-interface

Last synced: 7 days ago
JSON representation

The method reference is nothing but the simplified version of the lambda expression. Instead of providing an implementation body, a method reference refers to an existing available method

Awesome Lists containing this project

README

        

# Method Reference

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.

# Advantages of 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.

# Types of Method Reference
**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

## 📬 Contact

If you want to contact me, you can reach me through below handles.


linkedin
mail-me
whatsapp-me



💓Happy Coding😄💻