Is there an interface in Java similar to the Callable interface, that can accept an argument to its call method?
Like so:
public interface M
Normally arguments are not required as the method can have any number of arguments in its constructor.
final int i = 5;
final String word = "hello";
Future future = service.submit(new Callable() {
public String call() {
return word + i;
}
});
In this example i and word have been used, but you can "pass" any number of parameters.