Method References

In this lesson, you will learn about method references and explore its types.

Method references, as the name suggests are the references to a method. They are similar to object references. As we can have reference to an object, we can have reference to a method as well.

Similar to an object reference, we can now pass behavior as parameters. But, you might be wondering what the difference between a method reference and lambda expressions is. There is no difference. Method references are shortened versions of lambda expressions that call a specific method.

Let’s say you have a Consumer as defined below:

Get hands-on with 1400+ tech skills courses.