Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Darryl Failla
Sun Certified Java 2 Programmer
Originally posted by Jane Griscti:
The methods can only be called from synchronized code so 3 looks ok.
... synchronizing all the methods of the class on the same lock
Class-level
Single lock for all the object instances of the class.
Object-level
Tasks can call same method in different objects of the same class.
Method-level
Programmer specifies the methods which has to be synchronized.
SCJP2. Please Indent your code using UBB Code
Class-level
Single lock for all the object instances of the class.
SCJP2. Please Indent your code using UBB Code
SCJP2. Please Indent your code using UBB Code
Don't get me started about those stupid light bulbs. |