Why Wait and notify are kept in Object class although they
are used only with Thread Class
Answers were Sorted based on User's Feedback
Answer / srinivas
Since the locking mechanism happens at the Object level so
they are in Object Class.
| Is This Answer Correct ? | 21 Yes | 4 No |
Answer / chandrasekhar
wait(),notify() are worked on the objects to control the
multiple thereads,not on theread.Hence these methods are
difined object class.
| Is This Answer Correct ? | 14 Yes | 8 No |
What is the difference between heap and stack memory?
what is mean by method signature?
Write the algorithm to check the number non-leaf nodes in a tree.
What is a super class and how super class be called?
What will be the output of round(3.7) and ceil(3.7)?
What is volatile keyword in java
What is methodological theory?
Why stringbuffer is faster than string?
What is array pointers ?
which class is the wait() method defined in? : Java thread
Is JRE required to compile Java files ?
In what ways you can handle exception ?