lambda expression in Java

A lambda expression in Java is an anonymous method. However, this method is not executed on its own, instead, it implements a method defined in a functional interface. Thus, a lambda expression results in an anonymous class. 
Below syntax are valid lambda expressions in Java. Note the body of a lambda expression must be an expression or a statement block. It cannot be a statement. So both "()->true" and "()->{ return true; }" works, but "()->return true;" not work.
* parameter -> expression;
* (parameter1, parameter2) -> expression;
* (parameter1, parameter2) -> { code block };

Lambda expressions are usually passed as parameters to a function.
Lambda expressions can access static variables, instance variables, effectively final method parameters, and effectively final local variables.
Lambda expressions can be stored in variables if the variable's type is an interface which has only one method. The lambda expression should have the same number of parameters and the same return type as that method. 
```
interface Greeting {
  String say();
}

class Main {
  void show (Greeting g) {
    System.out.println(g.say());
  }

  public static void main(String[] args) {
    Main m = new Main();
    m.show(() -> "Hello, World!");
  }
}
```