What is yielding and sleeping? how they different?
Answers were Sorted based on User's Feedback
Answer / ranganathkini
When a thread yields, its execution is paused and loses
ownership of the monitor lock giving other waiting threads a
chance to run.
When a thread sleeps, its execution is paused for the
specified duration during such an idle period, the thread
continues to retain the ownership of the monitor lock.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / ravikiran
yield() method will suspend all the same priority thread
which is running and gives chance to next thread to run
which is of the same priority
sleep() method will make the thread to sleep for a
particular period of time which is specified in the
argument list
| Is This Answer Correct ? | 1 Yes | 2 No |
How do you allocate memory to object?
if the memory capacity is 700 presently occupied by process is 690. then another process request space(40) how this situation handled in java.
Explain the importance of finally over return statement?
Why should I use abstract class?
What is the range of the short type?
Can I use % with real numbers?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
What is difference between class and object in java?
Is null a string?
What is parseint?
Is arraylist dynamic in java?
What is dynamic dispatch in java?