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 to sort elements in a parallel array in java?
Can we use string in the switch case?
What is constructor
9 Answers Manforce, Tech Mahindra,
How do you square a number in java?
What is logical variable?
What is multi-catch block in java?
Difference between Linked list and Queue?
What is difference between path and classpath?
explain Anonynous inner class?
String Reverse in Java...!
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.
diffrence b\w println() and printf()