Page 1 of 1
About Question enthuware.ocpjp.v7.2.1254 :
Posted: Tue Oct 08, 2013 10:13 am
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
Re: About Question enthuware.ocpjp.v7.2.1254 :
Posted: Sun Oct 27, 2013 12:11 am
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.
Re: About Question enthuware.ocpjp.v7.2.1254 :
Posted: Wed Oct 14, 2015 9:04 pm
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.
Re: About Question enthuware.ocpjp.v7.2.1254 :
Posted: Wed Oct 14, 2015 9:49 pm
by admin
Updated to make it clear.
thank you for your feedback!