InterviewSolution
| 1. |
Static Synchronization Vs Instance Synchronization? |
|
Answer» When a static synchronized method is called, the PROGRAM obtains the class lock before CALLING the method. This mechanism is identical to the case in which method is non-static, it is just a different lock, and this lock is solely for static method. Apart from the functional RELATIONSHIP between the two LOCKS, they are not operationally related at all. When a static synchronized method is called, the program obtains the class lock before calling the method. This mechanism is identical to the case in which method is non-static, it is just a different lock, and this lock is solely for static method. Apart from the functional relationship between the two locks, they are not operationally related at all. |
|