I’m new to working with functional interfaces and I’m having difficulties implementing an interface I’ve made.
This is what the interface looks like:
<code>@FunctionalInterface
interface Operations<T> {
T operate(T o1, T o2);
}
</code>
<code>@FunctionalInterface
interface Operations<T> {
T operate(T o1, T o2);
}
</code>
@FunctionalInterface
interface Operations<T> {
T operate(T o1, T o2);
}
and this is the function the I’m trying to build:
<code> public static <T> T functions(T o1, T o2) {
`your text`T holder = SOMETHING.operate(o1, o2);
System.out.println("Result is " + holder);
return holder;
}
</code>
<code> public static <T> T functions(T o1, T o2) {
`your text`T holder = SOMETHING.operate(o1, o2);
System.out.println("Result is " + holder);
return holder;
}
</code>
public static <T> T functions(T o1, T o2) {
`your text`T holder = SOMETHING.operate(o1, o2);
System.out.println("Result is " + holder);
return holder;
}
What would you recommend me to do?
I’ve tried implementing the interface as if it was a class.