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

What is equals method in java?

0 Answers  


what is overloading in java?

13 Answers   Ascent, DNS, Infosys, SDA, VelTech,


What are the string methods in java?

0 Answers  


What happens when main () method is declared as private?

0 Answers   Tech Mahindra,


What is the difference between == and === javascript?

0 Answers  


What are methods of a class?

0 Answers  


Explain the concept of polymorphism with examples?

6 Answers   Summation Tech,


How big is a 32 bit integer?

0 Answers  


Why do we need strings in java?

0 Answers  


What is <> used for in java?

0 Answers  


Is java still necessary?

0 Answers  


Why only one Class is public in one file? Explain in details. Thanks in Advance.

12 Answers  


Categories