Suppose I would like to run static method foo asynchronously
void foo() throws Exception {...}
Since foo throws an exception I would prefer create a Callable and invoke ExecutorService.submit with it to get a Future.
Now I wonder how to declare those Callable and Future properly.
Should I declare them
Callable<Void> and Future<Void>?
Yes.
Voidis similar to the wrapper classesInteger,Longetc. for the primitive typesint,longetc. You could say it's a wrapper class forvoid, even thoughvoidis not really a type.