Is there an interface similar to Callable but with arguments?

Since Java 8 there is a whole set of Function-like interfaces in the java.util.function package. The one you’re asking for specifically is simply Function.

Prior to Java 8, there was no general-purpose, built-in interface for this, but some libraries provided it.

For example Guava has the Function<F,T> interface with the method T apply(F input). It also makes heavy use of that interface in several places.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)