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 |
How do you sort an array in java?
When should the method invokelater() be used?
Explain differences between checked and unchecked exceptions in java?
Which is bigger float or double?
What are the main concepts of oops in java?
Tell me a few examples of final classes defined in Java API?
What is a return in java?
How can constructor chaining be done using this keyword?
What are new features introduced with java 8 ?
Explain aggregation in java?
What are three types of loops in java?
When arithmeticexception is thrown?