Without "except class Thread" (or any other additional clarification for the matter) the question is ambiguous. If thread is just a concept, then class Thread belongs to "framework classes". Therefore, we always need class Thread (directly or indirectly - e.g. via ExecutorService) to run any code "in a separate thread". In other words, we cannot simply implement Runnable (correct answer) and "execute in a separate thread without using any other framework classes".What is/are the name(s) of the interface(s) that can be implemented by a class so that it can execute in a separate thread without using any other framework classes (except class Thread)?
About Question enthuware.ocpjp.v8.2.1496 :
Moderator: admin
-
- Posts: 6
- Joined: Sat Jun 18, 2016 2:11 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1496 :
Minor suggestion...
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1496 :
I see what you are saying but I do not completely agree with the statement that Thread class belongs to the "framework classes". By this logic, every java class belongs to "framework classes". I do agree that it could be a little bit ambiguous. I will leave this discussion here to get more feedback.
thank you,
Paul.
thank you,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 6
- Joined: Mon Feb 01, 2016 3:13 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1496 :
One can extend Thread and start it without using other classes. Runnable clearly rely on Thread. Please define framework classes? Which framework?
-
- Posts: 3
- Joined: Thu Feb 16, 2017 2:47 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1496 :
in original question (statement)
I got confused due withWhat is/are the name(s) of the interface(s) that can be implemented by a class so that it can execute in a separate thread without using any other framework classes
instead of can be executed or could be executed... meaning "Executor" is valid answer - Executor, a simple interface that supports launching new tasks. (https://docs.oracle.com/javase/tutorial ... inter.html )can execute
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1496 :
An Executor is not a task. An Executor executes tasks that are submitted to it.
If you like our products and services, please help us by posting your review here.
-
- Posts: 19
- Joined: Sun Aug 27, 2017 12:35 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1496 :
I totally agree with OP. This question is totally ambiguous. But... Oracle also is ambiguous in cert exams...
Who is online
Users browsing this forum: No registered users and 102 guests