InterviewSolution
| 1. |
What Is Synchronization In Java? |
|
Answer» The process of monitoring the access to shared resources by multiple threads so that only one thread can access one resource at time is known as synchronization. Synchronization is used to avoid DATA consistency and corruption problems and also to prevent any KIND of thread interference. Java PROVIDES a special keyword known as “synchronized” which can be used either for synchronizing a block of code or for synchronizing a METHOD.
The process of monitoring the access to shared resources by multiple threads so that only one thread can access one resource at time is known as synchronization. Synchronization is used to avoid data consistency and corruption problems and also to prevent any kind of thread interference. Java provides a special keyword known as “synchronized” which can be used either for synchronizing a block of code or for synchronizing a method. |
|