Albert Albert - 1 year ago 90
Java Question

Java: general function X->Y interface

I need an interface like:

interface Function<X,Y> {
Y eval(X obj);

Is there something like this in Java already or do I need to define my own?

Answer Source

Unfortunately, there's no such thing in the core Java libraries. As a consequence, many libraries define their own function-like interface. If you happen to use such a library already, you can re-use the function it uses.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download