About Question enthuware.ocpjp.v8.2.1496 :

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

Moderator: admin

Post Reply
uvsmtid
Posts: 6
Joined: Sat Jun 18, 2016 2:11 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1496 :

Post by uvsmtid »

Minor suggestion...
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)?
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".

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

Re: About Question enthuware.ocpjp.v8.2.1496 :

Post by admin »

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.
If you like our products and services, please help us by posting your review here.

olograph
Posts: 6
Joined: Mon Feb 01, 2016 3:13 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1496 :

Post by olograph »

One can extend Thread and start it without using other classes. Runnable clearly rely on Thread. Please define framework classes? Which framework?

atrofimov
Posts: 3
Joined: Thu Feb 16, 2017 2:47 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1496 :

Post by atrofimov »

in original question (statement)
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
I got confused due with
can execute
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 )

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

Re: About Question enthuware.ocpjp.v8.2.1496 :

Post by admin »

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.

ramon.carrascom
Posts: 19
Joined: Sun Aug 27, 2017 12:35 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1496 :

Post by ramon.carrascom »

I totally agree with OP. This question is totally ambiguous. But... Oracle also is ambiguous in cert exams... :cry:

Post Reply

Who is online

Users browsing this forum: No registered users and 72 guests