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



Why Wait and notify are kept in Object class although they are used only with Thread Class..

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

Why Wait and notify are kept in Object class although they are used only with Thread Class..

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

Post New Answer

More Core Java Interview Questions

How do you sort an array in java?

0 Answers  


When should the method invokelater() be used?

0 Answers  


Explain differences between checked and unchecked exceptions in java?

0 Answers  


Which is bigger float or double?

0 Answers  


What are the main concepts of oops in java?

0 Answers  






Tell me a few examples of final classes defined in Java API?

0 Answers   DELL,


What is a return in java?

0 Answers  


How can constructor chaining be done using this keyword?

0 Answers  


What are new features introduced with java 8 ?

0 Answers  


Explain aggregation in java?

0 Answers  


What are three types of loops in java?

0 Answers  


When arithmeticexception is thrown?

0 Answers  


Categories