1interface LambdaFunction {
2 void call();
3}
4class FirstLambda {
5 public static void main(String []args) {
6 LambdaFunction lambdaFunction = () -> System.out.println("Hello world");
7 lambdaFunction.call();
8 }
9}
1Runnable r = ()-> System.out.print("Run method");
2
3// is equivalent to
4
5Runnable r = new Runnable() {
6 @Override
7 public void run() {
8 System.out.print("Run method");
9 }
10 };