Thursday 26 May 2016

Functional style in java.

Functional style in java.

Function<T,R> function = new  Function<T,R>();
Type Parameters:
T - the type of the input to the function
R - the type of the result of the function

Ref : Oracle

ex :
It is the explicit intent to make it more convenient to program in a functional style in Java. Now, in mathematics, a function is generally written like

f: A -> B
(i.e., a function from As to Bs). This corresponds also to the notation in functional languages, Scala and already existing functional libraries for Java.

Ref : Stackoverflow 

No comments:

Post a Comment