java lock object code example Example: java thread syncronized locker synchronized void incrementSync() { count = count + 1; }