user8483670 wrote:Because we wait() on a lock, not on a thread, and every Object has a lock associated with it.
why wait() is there in Object class why not in Thread class .
while we use wait() in the case of thread environment?Because wait() causes the current thread to wait until some other thread does something. It wouldn't make sense to do that if there were no threads.
If there is any situation where we use it without using threads please mention with example. or link to that example..There is no Java program that doesn't use at least one thread, and the vast majority use many. Wait() is meaningless in a single-threaded environment.
839091 wrote:What part of the answers given did you not understand?
The question still remain un-answered as the answers provided are not clear. Can anybody explain why wait(), notify() methods are available in Object class and not thread?