Functional Interface

If any interface which has one and only one Abstract Method is called Functional Interface. Built in functional Interfaces are 1) Comparator Interface which has only one abstract method Example : compare(T arg1,T arg2) , Where T is the generic datatype. 2) Runnable Interface which has single abstract method Example : run() , like this […]

Share this article on

Lambda Expression

It is a shorter way of writing an implementation of a method which we can execute later at some point. Syntax : (arg1,arg2,arg3,…)  -> {body of implementing method}; (arg1,arg2,arg3,…) -> {body of implementing method}; Example 1 : (int x, int y,int z) -> {  return x + y + z; };   (int x, int […]

Share this article on
< Previous