Java Multithreading Question and Answers
25. | What's new with the stop(), suspend() and resume() method? |
---|---|
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2. | |
26. | Can a lock be acquired on a class? |
---|---|
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object. | |
27. | Can a method be static and synchronized? | ||||||
---|---|---|---|---|---|---|---|
No a static method can't be synchronized. | |||||||
|
28. | Explain Java Thread Life Cycle? |
---|---|
The life cycle of threads in Java is very similar to the life cycle of processes running in an operating system. During its life cycle the thread moves from one state to another depending on the operation performed by it or performed on it. A Java thread can be in one of the following states.
|
|