i have a small doubt in my mind that why notify() , wait() and notifyall() methods are in Object class i think all these methods are related to the Threads right??
they should be some reason for that can you tell me wat is that reason??
This question should probably be a sticky as we've answered it so many times .. if you search this forum you'll find several good answers and I recommend you do this.
The quick answer is they apply to a specific object instance i.e. if you didn't implement them on object you'd be left with implementing some static functions on say a class Threads that took a parameter of the object you wished to act on and then you'd have to be careful you passed the same object each time.
.. is that really better , I'd say not. I think every one would take the point that its not that intuitive to look for thread operations on object (had that feedback from many people) but once your past that initial 5 minutes of confusion (i.e. remembering to look at class object) it does work quite neatly and make sense ... honest ;-)
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5