What is use of synchronized keyword?

What is use of synchronized keyword?

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.


Multithreading in java.


By:Jalees
Date:2011-01-09 00:00:00

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.


Multithreading in java.


By:Sumit Tripathi
Date:2018-05-15 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher