Giter Club home page Giter Club logo

shubh2-0 / method-references Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 24 KB

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

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

method-references's Introduction

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.

linkedinmail-mewhatsapp-me


💓Happy Coding😄💻

method-references's People

Contributors

shubh2-0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.