Skip to content
Advertisement

Tag: functional-interface

When to use Functional Interface vs Function

I am using Java 11, and we have two ways of passing in functions as an argument. functional interface Function<T, Y> Now I am not able to find anything on when to use which one. I can figure that we can use a generic functional interface over a Function<T,Y> when we either don’t want to pass any arguments or have

Trying to mimic java functional interface

I am trying to mimic the java’s Function<T,R> by writing below code : when I am writing below code in andThen, it’s working fine (pointing to apply(T t) of interface) and perfectly chaining the other functional implementations But when writing below snippet, it’s falling into recursion, logically that’s correct , but why in snippet A, after.apply(apply(t)) is calling outer apply(T

Advertisement