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 to sort elements in a parallel array in java?

0 Answers  


Can we use string in the switch case?

0 Answers  


What is constructor

9 Answers   Manforce, Tech Mahindra,


How do you square a number in java?

0 Answers  


What is logical variable?

0 Answers  






What is multi-catch block in java?

0 Answers  


Difference between Linked list and Queue?

0 Answers   Virtusa,


What is difference between path and classpath?

0 Answers  


explain Anonynous inner class?

6 Answers   TCS,


String Reverse in Java...!

5 Answers  


class A { private int i; } class B extends A { private int i; } if I create an object of B class what will be the memory of that object.

2 Answers   Yamaha,


diffrence b\w println() and printf()

8 Answers   NIIT,


Categories