Posts

Showing posts from July, 2021

Functional Interface in Java

Image
  Functional Interface                Java 8 was released in 2014 and it was one of the major release. Among all other exciting features of Java 8, Lambda Expression is one of the most talked feature. But to use the Lambda Expression we need to know Functional Interface which is another feature introduced in Java 8. As per Java documentation Lambda expressions let you express instances of single-method classes more compactly Functional Interface has been introduced in Java to support lambda expression. So before start diving deeper into lambda expression, it is crucial to understand Functional Interface.  No doubt that interface has gone through a lot of changes in Java 8. Before Java 8, all methods declared in interfaces= are public and abstract by default. But to address the backward compatibility issue, post Java 8 interface can have default methods and static methods. But then what is special ab...