InterviewSolution
Saved Bookmarks
| 1. |
What is the synchronization process? Why use it? |
|
Answer» Synchronization is basically a process in java that enables a SIMPLE strategy for avoiding thread interference and memory consistency errors. This process makes sure that resource will be only used one thread at a time when one thread tries to access a SHARED resource. It can be achieved in three different WAYS as given below:
Syntax: synchronized (object) { //STATEMENT to be synchronized } |
|