What is yielding and sleeping? how they different?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about automatic type conversion in java?

556


Can we override the static methods?

558


What is an empirical question?

533


What is mutable object and immutable object?

622


Explain list interface?

509






What is a string what operation can be performed out with the help of a string?

500


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

528


What is executor memory?

506


Do I need java for windows 10?

538


What does the ‘static’ keyword mean? Is it possible to override private or static method in java?

555


Does java vector allow null?

528


Explain about varargs in java?

571


Tell me a few examples of final classes defined in Java API?

554


What does java stand for?

536


What are the 3 types of loops in java?

521