In general, threads will work on locks. Every thread will aquire the lock first and start executing the tasks.
Threads itself don't have locks. So in Java Object class is the super class for all the classes. These methods should be available for all the classes.
That is why wait(),notify() and notifyAll() methods are provided in Object class.
Threads itself don't have locks. So in Java Object class is the super class for all the classes. These methods should be available for all the classes.
That is why wait(),notify() and notifyAll() methods are provided in Object class.
No comments:
Post a Comment