How can the wait() and notify() methods be called on Objects that are not Threads? That doesn\'t really make sense, does it?
Surely, it mus
Actually, wait, notify member function should not belong to thread, the thing it should belong to name as condition variable which comes from posix thread . And you can have a look how cpp wrap this, it wrap it into a dedicated class std::condition_variable.
Java haven't do this kind encapsulation, instead, it wrap condition variable in more high level way: monitor (put the functionality into Object class directly).
If you don't know monitor or condition variable, well, that indeed make people confused at the beginning.