Java

What is a functional interface in Java8? Quick explanation and sample.

Any interface with a single abstract method is a functional interface and its implementation may be treated as lambda expression. It can have only a single functionality. However a functional interface can have unlimited default methods. Note, that default methods have implementation and abstract methods – not. The latter can be only one in functional interface. When defining your own…

Continue Reading

Java

What is Lambda expression in Java8? Quick explanation and Sample.

Lamba expression – an anonymous function that can be passed to or returned from a method.¬†The most simple case of a lambda is a functional interface with a single method which receives some values and return a value. Actually any¬†interface with a single abstract method can be treated as functional interface. Its implementation is called Lambda expression. So it is…

Continue Reading