Looking at the javadocs it just says
Future submit(Runnable task, T result) Submits a Runnable task for executio
You can mutate the object that was passed-in during the task. For example:
final String[] mutable = new String[1];
Runnable r = new Runnable() {
public void run() {
mutable[0] = "howdy";
}
};
Future f = executorService.submit(r, mutable);
String[] result = f.get();
System.out.println("result[0]: " + result[0]);
When I run this code it outputs:
result[0]: howdy