what is the difference between sleep() and Wait()?

Answer Posted / vijay

Sleep():

Pause for NUMBER seconds. SUFFIX may be 's' for seconds
(the default), 'm' for minutes, 'h' for hours or 'd' for
days. Unlike most implementations that require NUMBER be
an integer, here NUMBER may be an arbitrary floating point
number.


Wait():

The wait function suspends execution of the current
process until a child has exited, or until a signal is
delivered whose action is to terminate the current
process or to call a signal handling function. If a child
has already exited by the time of the call (a so-
called "zombie" process), the function returns
immediately. Any system resources used by the child are
freed.

Is This Answer Correct ?    5 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between static binding and dynamic binding?

582


What are the default and parameterized constructors?

568


What language is an assembler written in?

567


Explain the difference between private, public, package and protected in java?

615


What are different types of references?

552






how to create multithreaded program? Explain different ways of using thread? : Java thread

545


How does hashset works in java?

551


Can we have return statement in finally clause? What will happen?

529


What are different ways of object creation in java ?

593


When is the arraystoreexception thrown?

587


Break statement can be used as labels in java?

564


Can you achieve runtime polymorphism by data members?

611


Can you inherit from an abstract class java?

548


Can we initialize the final blank variable?

603


Why is method overloading not possible by changing the return type in java?

603