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
About Question enthuware.ocpjp.v7.2.1254 :
Moderators: Site Manager, fjwalraven
-
- Posts: 53
- Joined: Fri Sep 20, 2013 7:20 am
- Contact:
-
- Posts: 53
- Joined: Thu Nov 22, 2012 12:01 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1254 :
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.
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.
-
- Posts: 31
- Joined: Tue Oct 06, 2015 1:57 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1254 :
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.
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1254 :
Updated to make it clear.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 4 guests