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 |
what are the high-level thread states? : Java thread
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()?
Can we define package statement after import statement in java?
What are the object and class classes used for?
What happens if an exception is throws from an object's destructor?
What is continuity of a function?
what is meant by encapsulation?
What are the advantages of java inner classes?
What is defined as false sharing in the context of multithreading?
What is difference between == equals () and compareto () method?
What is your platform’s default character encoding?