Methods call for the wait (), notify(), notifyall(), must be placed in side a synchronized block Is this always true ? Explain�
We can put these methods inside a non synchronized method or code without compile �time errors. Can you explain the logic behind this?
posted 12 years ago
All those methods do need to be inside appropriate synchronisation. However, the lock could be obtained in some other piece of code, which then calls the method containing the wait(), notify() or whatever. Therefore, the compiler can't enforce this.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.