Java:Lambda
Functional Interface
functional interface – an interface with a single abstract method. The Java API has many one-method interfaces such as Runnable, Callable, Comparator, ActionListener and others. They can be implemented and instantiated using anonymous class syntax.
Labmda expression
public interface Hello {
public void sayHello(String who);
}
public interface Print<T> {
public void print(T msg);
}
public static void main(String[] args) {
Hello h = (String s) -> System.out.println(s);
h.sayHello("Riguz");
Print<Float> p = (f) -> {
System.out.println(f);
System.out.println("Labmda");
};
p.print(new Float(3.1415926f));
}