interface MyFunction {
int operation(int a, int b);
}
then I can do
MyFunction addition = (int a, int b) -> a + b;
MyFunction subtraction = (int a, int b) -> a - b;
If I want to define function between other types, I can do
interface MyFunction<T,U,V> {
V operation(T a, U b);
}
But what if I want to define MyFunction
to work with 3 arguments? (without creating another interface)