Hi there,
isn't java.util.concurrent.Executor.execute(Runnable) another option here? I can pass in a Thread instance, too.
The question does not explicitly ask for a method within the Thread class.
Regards,
Bernhard
About Question enthuware.ocpjp.v7.2.1561 :
Moderators: Site Manager, fjwalraven
-
- Posts: 14
- Joined: Wed Oct 09, 2013 3:13 am
- Contact:
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1561 :
Executor.execute doesn't really schedule a thread for execution. It already has threads and those thread are already executing. Executor.execute actually schedules a "task" for execution and it uses its own managed threads to execute that task. It is a different matter that the "task" is captured using a Runnable or Callable (as the case may be).
HTH,
Paul
HTH,
Paul
-
- Posts: 14
- Joined: Wed Oct 09, 2013 3:13 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1561 :
Thanks for clearing that up!
-
- Posts: 29
- Joined: Wed Apr 17, 2013 9:22 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1561 :
The word "schedule" has confused me a lot. I actually thought it's about ScheduledExecutorService's scheduleXXX() methods.
Who is online
Users browsing this forum: No registered users and 6 guests