Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/shubh2-0/method-references
- Owner: Shubh2-0
- Created: 2023-03-05T20:38:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-08T11:55:08.000Z (about 1 year ago)
- Last Synced: 2024-05-01T13:47:22.051Z (7 months ago)
- Topics: consumer-functional-interface, function-functional-interface, functional-programming, java, java-8, lambda-functions, method-reference, predicate-functions, sts4, supplier-functional-interface
- Language: Java
- Homepage:
- Size: 23.4 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.
💓Happy Coding😄💻