why the wait,notify,notifyall methods are placed in object
class?these are the thread concepts why these methods are
placed in Object class?
Answers were Sorted based on User's Feedback
Answer / vinayakkatkar
wait notify method can be use din some applications where we
have producer consumer mechanism
so they need not be the methods of thread class
and they must be available to the all classes not extending
the thread class
hence the reason
Hi, I have created a blog named as knowledge is free
where you can download many useful e-books on java ,linux,
php , c ,c++
and also request books to me.
I will make it available to all of you. Please tell your
friends to visit the blog
This is the link to blog
http://vinayakkatkar.blog.co.in
--
vinayak
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / subhareddy
wait ,notify,notifyall are the methods defined in object
class because we call them on object not on threads.so they
are defined in object class.
| Is This Answer Correct ? | 8 Yes | 13 No |
What is an anonymous class?
What modifiers are used with a top level class?
How many unicode characters are there?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
. Define Copy Constructor in Java
Does constructor creates the object ?
all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.
Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.
How will you measure that int takes up only 32 bits in memory?
What are the six ways to use this keyword?
Why constructor has no return type?
What does the three dot emoji mean?