This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
RE:synchronize a static method
Posted by Kishori Sharan on July 24, 2000 at 11:21 AM
Hi a. Can we synchronize a static method Ans: Yes. You can synchronize a static method. b. if YES what is its effect in multi threading environment. Ans: If one thread is executing a static synchronized method of a class then it holds a lock on all other syncronized methods of that class and in effect no other thread can call any of the synchonized static methods of that class untill this current thread releases the lock. c. if NO why Ans: --- Thanx Kishori
Replies:
|