hi wahid
if u have a some data in u r class and have defined some methods to modify that and read that or use that.
now if u create a number of threads to manipulate the data and also some threads to read or use the data.
now consider the case when the threads which change the data has changed one instance variable and didnt get time to change other variable (which is important for the object ) and another
thread gets time then the data is inconsistent then that thread which got the time will modify or use the data which is inconsistent and this will corrupt the data
so in
java we synchronize such methods so that only one thread can access the data and others has to wait for the thread which is accessing the data to wait till the thread finishes it work so that the data wont be corrupt.
hope this clear u r doubt if still in doubt refer the books most books have given a good explanation for this