Well..locks are used to obtain lock on any object.As simple as that...
seee when multiple threads are working on a single object and you want to synchronize then each
thread should obtain lock on object before operating...
it is same as monitor concept in operating systems...