About Question enthuware.ocpjp.v7.2.1688 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
krohani
Posts: 31
Joined: Tue Oct 06, 2015 1:57 pm
Contact:

About Question enthuware.ocpjp.v7.2.1688 :

Post by krohani »

Paul - I have a question about shutdownNow() method in ExecutorService. The API (and your answer) shows that it returns a list of runnable tasks that were awaiting execution. Here is my question...

1. You can submit both runnables and callables to the executorservice and I don't believe they inherit from each other so what happens to the callables that were awaiting execution when the shutdownNow is called. They don't get returned back in this list, correct?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1688 :

Post by admin »

The API doesn't say anything about that but I believe it is possible for the method to return both by wrapping a Callable into a Runnable. You would have to look into the source code of some concrete ExecutorService to see what it actually does.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests