Situation-synchronize piece of your code

In which situation you will synchronize a piece of your code?

E

Expert

Verified

While you are expecting that your shared code will be accessed by different threads and these threads can modify specific data causing data corruption, then they are located in a synchronized construct or in a synchronized method.

   Related Questions in JAVA Programming

©TutorsGlobe All rights reserved 2022-2023.