1 | Synchronized methods and blocks are implemented in the applet class by acquiring a lock before running |
2 | Code will therefore not run at the same time as other code that needs access to the same resource. |
3 | Each object has one lock associated with it and each class has exactly one lock |
4 | When invoked, a synchronized method waits until it can acquire the lock for the current instance (i.e., this); a static synchronized method waits to acquire the class lock |
5 | Lock is released when code is done executing |
6 | Locks are advisory |
7 | synchronized blocks specify the object on which to synchronize |