I have been studying an example java code written by someone and faced the following snippet:
Runnable runnable = () -> System.out.println("Thread name: " + Thread.currentThread().getName());
Executor executor;
executor = Runnable::run;
executor.execute(runnable);
So, I can't figure out how method reference in this case makes it possible to instantiate an Executor and how is it possible to call execute(Runnable command) if it was not implemented. In general how does the method reference works in this case behind the curtains?