Again I encountered this problem.
Again I got it wrong.
Question 22)
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
I always think 2) is incorrect but everytime I am wrong.
I think in time-slicing system,even when a thread with higher priority gets runnable,the thread scheduler won't let it to run until the original running thread finishes its time-slice.
Please help me with this.I am appearing the
test in 3 days.
If I encounter this question again in real test,should I choose it or not?