🌐
Oracle
docs.oracle.com › javase › tutorial › java › javaOO › methodreferences.html
Method References (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
Similarly, the method reference myApp::appendStrings2 invokes the method appendStrings2 that is part of the object myApp. The JRE infers the method type arguments, which in this case are (String, String). The following is an example of a reference to an instance method of an arbitrary object of a particular type:
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-method-references
Java Method References - GeeksforGeeks
2 weeks ago - Java Method References are a shorthand way to refer to an existing method without invoking it. They were introduced in Java 8 to make lambda expressions shorter, cleaner, and more readable.
🌐
Baeldung
baeldung.com › home › java › core java › method references in java
Method References in Java | Baeldung
March 26, 2025 - In this quick tutorial, we learned what method references are in Java and how to use them to replace lambda expressions, thereby improving readability and clarifying the programmer’s intent.
🌐
Tutorialspoint
tutorialspoint.com › java › java_method_references.htm
Java - Method References
Method references were introduced in Java 8. Method reference is a special type of lambda expression. It fulfils the purpose of a lambda expression by increasing the readability and to write a neat code.
🌐
Scaler
scaler.com › home › topics › method reference in java 8
Method Reference in Java 8 - Scaler Topics
April 28, 2024 - Method references are a new feature of Java 8. They are a short and easily readable writing syntax for a lambda expression. Use a method reference to refer to a functional interface method.
🌐
Belief Driven Design
belief-driven-design.com › functional-programming-with-java-method-references-c9103cdf5f8
Functional Programming With Java: Method References | belief driven design
September 19, 2022 - Besides lambdas expressions, Java 8 introduced another language syntax change in the form of a new operator, :: (double colon), to create so-called method references.
🌐
Codementor
codementor.io › community › java 8 method reference: how to use it
Java 8 Method Reference: How to Use it | Codementor
January 18, 2017 - In Java 8, thanks to lambda expressions, we can do something like this. We can use methods as if they were objects, or primitive values. A method reference is the shorthand syntax for a lambda expression that executes just ONE method.
🌐
danvega.dev
danvega.dev › blog › 2024 › 08 › 01 › java-method-references
Java Method References - A Beginner's Guide
August 1, 2024 - Method references, introduced in Java 8, are a concise shorthand for referring to methods or constructors. Think of them as a way to say, "Hey Java, use this method here!" without writing out the entire method call.
🌐
Codefinity
codefinity.com › courses › v2 › 190d2568-3d25-44d0-832f-da03468004c9 › c0bcd017-ff39-46ec-bc93-acd569f3497d › f79fe204-c582-4430-9d5e-d6b6377d741e
Learn Method Reference in Java | Advanced Java Features and Techniques
In summary, method references do not add any programmatic burden. They do not optimize the process but also do not complicate it. This construction is simply for reducing the written code slightly and improving readability. Whether to use lambda expressions or method references is up to you.
Find elsewhere
🌐
DZone
dzone.com › coding › languages › java lambda: method reference
Java Lambda: Method Reference
October 11, 2018 - In a method reference, you place the object (or class) that contains the method that you want to call before the delimiter :: operator and the name of the method is provided after it without arguments.
🌐
JavaTechOnline
javatechonline.com › home › method reference in java 8 [::]
Method Reference In Java 8 [::] - JavaTechOnline
July 10, 2025 - Method Reference is a new feature of Java 8. Using Method Reference, we provide a reference to already existing method (with similar argument types) to facilitate the implementation of a functional interface using a double colon (::) operator.
🌐
DEV Community
dev.to › dhanush9952 › method-references-in-java-4690
Method References :: in Java - DEV Community
November 11, 2024 - Method references in Java provide a concise way to refer to methods without invoking them. They are a part of the lambda expressions feature introduced in Java 8, designed to simplify the syntax and improve code readability.
Top answer
1 of 1
10

Good place you to start understanding the method reference is the Oracle Documentation, that says:

You use lambda expressions to create anonymous methods. Sometimes, however, a lambda expression does nothing but call an existing method. In those cases, it's often clearer to refer to the existing method by name. Method references enable you to do this; they are compact, easy-to-read lambda expressions for methods that already have a name.

Think of it this way:

"Method definition (particular body, signature and a return type) exists; why shall I create a new lambda expression if I can reuse existing code? let's refer to the already defined method and reuse it."


Four kinds of method references:

  1. SomeType::staticMethodName - reference to the static method (you just refer to the static method of "SomeType" class);

  2. someTypeInstance::instanceMethodName - reference to the instance method of a particular object (here, you need an actual object, from which you obtain the method reference);

  3. SomeType::instanceMethod - reference to the instance method of an arbitrary object of a particular type (you do not need to explicitly create an object in this case);

  4. SomeType::new - reference to the constructor (you simply refer to the constructor).


Difference between (2) the particular object's method reference and (3) arbitrary object's method reference:

In the first two examples, the method reference is equivalent to a lambda expression that supplies the parameters of the method. For example:

System.out::println == x -> System.out.println(x);
Math::pow == (x, y) -> Math.pow(x, y)

In the third case, the first parameter becomes the target of the method, as in:

String::compareToIgnoreCase == (x, y) -> x.compareToIgnoreCase(y)
🌐
Hero Vired
herovired.com › learning-hub › topics › method-reference-in-java-8
Method Reference in Java 8: Explained with Code Examples
September 20, 2024 - In Java, methods are defined within classes and are called using objects or class names. ... Method references allow us to use a currently existing method just as an argument to the function.
🌐
BeginnersBook
beginnersbook.com › 2017 › 10 › method-references-in-java-8
Method References in Java 8
September 11, 2022 - 1. Method reference to an instance method of an object – object::instanceMethod 2. Method reference to a static method of a class – Class::staticMethod 3. Method reference to an instance method of an arbitrary object of a particular type – Class::instanceMethod 4.
🌐
InfoWorld
infoworld.com › home › blogs › java challengers
How to use method references in Java | InfoWorld
October 24, 2025 - They are a concise way to refer to methods of classes or objects. Method references are especially useful in the context of lambda expressions, where they are used to write cleaner, more readable code.
🌐
Medium
medium.com › javarevisited › the-elusive-and-beautiful-java-method-reference-97e566d2088b
The elusive and beautiful Java Method Reference | by Donald Raab | Javarevisited | Medium
December 26, 2022 - We had the “With” methods in Eclipse Collections years before Method References arrived in Java 8. We initially added them so we could create more opportunities to hoist up anonymous inner classes into static variables to reduce garbage generation. We used to call these “fat free closures” as they didn’t require you to keep adding new objects to the heap.
🌐
Medium
medium.com › @mehmed6 › method-reference-in-java-making-your-code-cleaner-95b98a74e783
Method Reference in Java: Making Your Code Cleaner | by Mehmet Dogan | Medium
October 7, 2023 - In Java programming, one way to make your code cleaner and more readable is to use “Method Reference.” This feature, introduced in Java 8 and onwards, offers a concise way to invoke a function or method.
🌐
Java and OOP
skeoop.github.io › java8 › Method-References
Method References | Java and OOP
A method reference is a syntax for defining a reference to a single method.
🌐
CodingNomads
codingnomads.com › java-method-references-introduction
What is a Java Method Reference?
In Java, you can refer to a method without executing it. This has a specific syntax, and it's called a method reference. Method references are a great way to pass a method as a parameter or to assign it to a functional interface.