0

(This question is not related to what the method reference is used for and I couldn't find any proper answer here about the method calls itself)

Is there any differences between calling a static/non-static method within the class with method reference and a regular call, for example:

public class FooClass {
    private static void foo() {
        ...
    }

    private void testCalls() {
        FooClass.foo(); //Regular call
        // vs.
        FooClass::foo; //Method reference
    }
}

I know that method reference is related to lambda, but in this case I want to ignore those capabilities, and only compare the calls. Is there a difference in terms of method calls and is one better/prefered than the other?

RisKakaN
  • 93
  • 1
  • 13

0 Answers0