About Question enthuware.ocpjp.v7.2.1561 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
thisOtterBeGood
Posts: 14
Joined: Wed Oct 09, 2013 3:13 am
Contact:

About Question enthuware.ocpjp.v7.2.1561 :

Post by thisOtterBeGood »

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

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

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

Post by admin »

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

thisOtterBeGood
Posts: 14
Joined: Wed Oct 09, 2013 3:13 am
Contact:

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

Post by thisOtterBeGood »

Thanks for clearing that up!

insider
Posts: 29
Joined: Wed Apr 17, 2013 9:22 am
Contact:

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

Post by insider »

The word "schedule" has confused me a lot. I actually thought it's about ScheduledExecutorService's scheduleXXX() methods.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests