Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how can a Runnable have a return value in the ExecutorService interface?

843785Feb 25 2009 — edited Feb 26 2009
in the ExecutorService interface, please conside the method:

public Future<T> submit(Runnable task, T result);
Submits a Runnable task for execution and returns a Future representing that task.

i don' understand how a Runnable can have a return value.
could someone some me a short example?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2009
Added on Feb 25 2009
5 comments
1,988 views