Concurrency - Synchronization in java.
Java offers two basic synchronization idioms:
The Java programming language neither prevents nor requires detection of deadlock conditions.
To create synchronized code (ie which gives consistent values) between threads, you use the synchronized word..
Synchronization is implemented by an internal entity known as the monitor (intrinsic lock or monitor lock).