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 |
If I have 1000 objects and my requirement is to sort them quickly, then which collection would you recommend and why?
Can we call virtual funciton in a constructor ?
Can a class extend 2 classes in java?
Do you need to import math in java?
What is regex java?
What is the default access specifier for variables and methods of a class?
Difference between a class and an object?
What is java reflection api?
What is methodological theory?
What is meant by javabeans?
Can I declare a class as private?
In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????