Unable to figure out behaviour : Method reference with lambda
问题 Consider below code, class DemoStatic { public static Runnable testStatic() { return () -> { System.out.println("Run"); }; } public void runTest () { Runnable r = DemoStatic::testStatic; r.run(); } } public class MethodReferenceDemo { public static void main(String[] args) { DemoStatic demo = new DemoStatic(); demo.runTest(); } } run() method of Runnable instance that is being return by testStatic method was supposed to be invoked. And output on console should be "Run". But this code is not