About Question enthuware.ocpjp.v7.2.1254 :

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

Moderator: admin

Post Reply
sir_Anduin@yahoo.de
Posts: 62
Joined: Fri Aug 07, 2015 2:16 pm
Contact:

About Question enthuware.ocpjp.v7.2.1254 :

Post by sir_Anduin@yahoo.de »

How is "None of the above are correct" the correct answer if even the explanation says that:
A Thread is created by doing new ClassThatExtendsThread() OR by doing new Thread(classImplementingRunnable);
The newly created Thread is started by calling start().
As far as I understand you have to call the start() method on a Thread object to have a parall execution. This makes anser 1 correct for me.

Also the explanation for answer 1
The class can also implement Runnable.
does not make sense, because, if you call the run method of the Runnable it will be executed in the main thread.

Maybe I am missunderstanding the "To provide threading behavior" statement...

Thanks

Aleks

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

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

Post by admin »

When you are talking about threading behavior you are only talking in a general sense about how to write a class that can be used create threads. You can do that either by extending that class from Thread or making it implement Runnable so that you can pass it to new Thread( runnable ).

I agree with you that the statement, "threading behavior" is not very precise and can cause confusion.

Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests