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 are the high-level thread states? : Java thread

0 Answers  


String is an immutable object. Then how can the following code be justified. String s1 = ?ABC?; String s1 = s1+?XYZ?; s.o.p(s1); The output is ABCXYZ, which is the value of s1 ?

6 Answers   Flextronics, Keane India Ltd,


Can we call the run() method instead of start()?

0 Answers  


Can we define package statement after import statement in java?

0 Answers  


What are the object and class classes used for?

0 Answers  






What happens if an exception is throws from an object's destructor?

0 Answers   Amazon,


What is continuity of a function?

0 Answers  


what is meant by encapsulation?

0 Answers   Aspire,


What are the advantages of java inner classes?

0 Answers  


What is defined as false sharing in the context of multithreading?

0 Answers  


What is difference between == equals () and compareto () method?

0 Answers  


What is your platform’s default character encoding?

0 Answers  


Categories