submit
Submits a value-returning task for execution and returns a Future representing the pending results of the task. Upon completion, this task may be taken or polled.
Return
a Future representing pending completion of the task
Parameters
task
the task to submit
Throws
if the task cannot be scheduled for execution
if the task is null
Submits a Runnable task for execution and returns a Future representing that task. Upon completion, this task may be taken or polled.
Return
a Future representing pending completion of the task, and whose get() method will return the given result value upon completion
Parameters
task
the task to submit
result
the result to return upon successful completion
Throws
if the task cannot be scheduled for execution
if the task is null