Back
You need to be in a synchronized block in order for Object.wait() to work.
Also, I recommend looking at the concurrency packages instead of the old school threading packages. They are safer and way easier to work with.
Happy coding.
I assumed you meant Object.wait() as your exception is what happens when you try to gain access without holding the objects lock.
31k questions
32.8k answers
501 comments
693 users