One of the most powerful feature of Java is its multithreading mechanism.The synchronization is used to coordinate the activities between the multiple threads.
Java uses the monitor to synchronize the methods or the block of code. A \'synchronized\' keyword is used with the method signature or before a block of code.
If all the thread of the class want to access the same method concurrently, monitor helps them to synchronize the accessone thread at a time by locking the resource being accessed on the accessing object.
One of the most powerful feature of Java is its multithreading mechanism.The synchronization is used to coordinate the activities between the multiple threads.
Java uses the monitor to synchronize the methods or the block of code. A \'synchronized\' keyword is used with the method signature or before a block of code.
If all the thread of the class want to access the same method concurrently, monitor helps them to synchronize the accessone thread at a time by locking the resource being accessed on the accessing object.