Java method references allow you to refer to methods using functional interfaces in a simple way. They are used instead of lambda expressions when the lambda only calls an existing method.
In this chapter, you will learn about Java Method References, their types (static, instance, and constructor), syntax, and how to use them with functional interfaces through practical examples.
A method reference is a shorthand notation used to call a method by referring to it directly using the :: operator. It is a compact alternative to lambda expressions when the lambda simply invokes an existing method.
There are following types of method references in java:

You can refer to static method defined in the class. Following is the syntax and example which describe the process of referring static method in Java.
It has the following syntax:
In the following example, we have defined a functional interface and referring a static method to it's functional method say().
Output:
Hello, this is static method.
In the following example, we are using predefined functional interface Runnable to refer static method.
Output:
Thread is running...
You can also use predefined functional interface to refer methods. In the following example, we are using BiFunction interface and using it's apply() method.
Output:
30
You can also override static methods by referring methods. In the following example, we have defined and overloaded three add methods.
Output:
30 30.0 30.0
like static methods, you can refer instance methods also. In the following example, we are describing the process of referring the instance method.
It has the following syntax:
In the following example, we are referring non-static methods. You can refer methods by class object and anonymous object.
Output:
Hello, this is non-static method. Hello, this is non-static method.
In the following example, we are referring instance (non-static) method. Runnable interface contains only one abstract method. So, we can use it as functional interface.
Output:
Hello, this is instance method
In the following example, we are using BiFunction interface. It is a predefined interface and contains a functional method apply(). Here, we are referring add method to apply method.
Output:
30
You can refer a constructor by using the new keyword. Here, we are referring constructor with the help of functional interface.
It has the following syntax:
In this example, a constructor reference (Message::new) is used to create an object of the Message class through a functional interface in a concise and readable way.
Output:
Hello
We request you to subscribe our newsletter for upcoming updates.