Hi everybody,
Q1) Does giving another
thread higher priority stops the execution of the current thread?
Q2) How to find out if a thread is the owner , ie., it owns the lock on the object ?
Q3) Explain why cant u find out if an alive thread is runnable or blocked, or if a runnable thread is actually running, or u cannot differentiate between a thread that has not yet become runnable and one that has already died ?
Q4) Explain join() & yield() methods of the Thread class?
Q5) Waht is the difference between join(), wait(), sleep(), and yield() methods ?
Q6) Explain the following :
When a thread is sleeping it cant actually check whether it should terminate. This is where the interrupt() method comes in. When the interrupt() method is called on a thread object that is currently blocked, the blocking call (such as sleep() or wait() ) is terminated by an InterruptedException.