About Question enthuware.ocpjp.v7.2.1254 :

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
Student
Posts: 53
Joined: Fri Sep 20, 2013 7:20 am
Contact:

About Question enthuware.ocpjp.v7.2.1254 :

Post by Student »

I answered c) because "When code running in some thread creates a new Thread object, the new thread...is a daemon thread if and only if the creating thread is a daemon".

It's not clear from the option whether "Threads created by user are always non-daemon threads." means
a) "Threads created by user [threads] can never be non-daemon threads" or
b) "Threads created by user [threads] are always created as non-daemon threads."

I took it to mean the latter, hence gave the wrong answer even though I knew the distinction. I hope I don't get such a question in the exam o-0

icepeanuts
Posts: 53
Joined: Thu Nov 22, 2012 12:01 am
Contact:

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

Post by icepeanuts »

FYI.

public final void setDaemon(boolean on)
Marks this thread as either a daemon thread or a user thread. The Java Virtual Machine exits when the only threads running are all daemon threads. This method must be invoked before the thread is started.

krohani
Posts: 31
Joined: Tue Oct 06, 2015 1:57 pm
Contact:

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

Post by krohani »

Student wrote:I answered c) because "When code running in some thread creates a new Thread object, the new thread...is a daemon thread if and only if the creating thread is a daemon".

It's not clear from the option whether "Threads created by user are always non-daemon threads." means
a) "Threads created by user [threads] can never be non-daemon threads" or
b) "Threads created by user [threads] are always created as non-daemon threads."

I took it to mean the latter, hence gave the wrong answer even though I knew the distinction. I hope I don't get such a question in the exam o-0

I agree that the wording on this question is ambiguous. I also took answer C - Threads created by the user are always non-daemon threads as the correct answer. I already know/knew that you can call setDaemon but that is an explicit call and by default all user threads are not daemon threads. Confusing wording in the answers.

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

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

Post by admin »

Updated to make it clear.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests