What is the use of synchronization?

thanhthao

New member
What is the use of synchronization?
Answer
To avoid such issues, Java provides us with the synchronized keyword, which acts like a lock to a particular resource. This helps achieve communication between threads such that only one thread accesses the synchronized resource and other threads wait for the resource to become free.
 

Tìm kiếm

Back
Top