Originally posted by Norm Radder:
I saw some posted code on another forum that had some methods in a class with both static and synchronized modifiers:
public static synchronized int aMethod(<parms> {
Is there an object for the methods to synch on?
Would the synchronized modifier be any use?
static identifier says, no instance of the class is required to access that method and static synchronized says, you need class level lock to access that method. In other words, more than one static synchronized methods can't be executing simultaneously, as there is only class level lock, therefore only one method (static synchronized) will be in execution in one moment of time.