This has lock on a single object(this) so all the methods which are synchronized cannot be accessed by another thread
It has lock on an object which can be defined by you let's say a String.
if u have four functions say put,get,push,pop & u want while pushing no thread shud be able to access pop but they can access put or get & vice versa then define single object for push & pop and another object for put & get.Remember lock is on an object
[ edited to use separate code blocks rather than one big one - the text in between code was treated as an overly long line of code, messing up the display - Jim ]
[ July 17, 2006: Message edited by: Ela Jha ]
[ July 17, 2006: Message edited by: Jim Yingst ]