Forums Register Login

Marcus Green question

+Pie Number of slices to send: Send
What can cause a thread to stop executing?
1) The program exits via a call to System.exit(0);
2) Another thread is given a higher priority
3) A call to the thread's stop method.
4) A call to the halt method of the Thread class?
Answer : 1,2,3
I answered 1,2 (not 3 because stop() is deprecated). If I get a question similar to this one, should I choose 3 even though the method is deprecated?
+Pie Number of slices to send: Send
In the exam there will not be questions about deprecated method. However if you are asked, stop will definitely stop the thread.
+Pie Number of slices to send: Send
That's tricky because it says "CAN" and not "WILL" I got that one wrong.
Curse your sudden but inevitable betrayal! And this tiny ad too!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 549 times.
Similar Threads
Questions from macrus
Marcus Green Exam 2, Question #22
macrus mock exam
stop method
Threads
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:37:10.