Why sleep()is in Thread and wait() in Object class? Why can't
I have both in one class or vice versa?
In Java "Object" class is super for all classes and every
entity we consider as object in java. Every object in java
has default behaviour of "Object" class.
Now come to the point, When you instantiate a thread you
may require to stop a while that particular thread.So
Thread class has sleep method.
But in the situation of multithreading, you may require wait
() and notify() methods so that you can invoke "Object"
class behavior to your class.
| Is This Answer Correct ? | 7 Yes | 3 No |
Why isn’t there operator overloading?
Why volatile is used in java?
What are different data structures in java?
Write java program to reverse string without using api?
how an we achive multiple inhetitance in java using interface..??
What methods are used to get and set the text label displayed by a button object?
What is method in research paper?
Does apple use java?
What is java util?
why String class is immutable.
How can we make string upper case or lower case?
is this possible to create an array of 0 length? if so how? if not so why? coz we have an array in main() likw this "static void main(String [] s) then what it signifies?