1 package lambda; 2 3 public class A { 4 main(String[] args)5 public static void main(String[] args) { 6 new A().run(new B()::doIt); 7 new A().run(B::doItStatic); 8 } 9 run(Runnable todo)10 public void run(Runnable todo) { 11 todo.run(); 12 } 13 14 } 15