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

Can an interface have a constructor?

509


In a container there are 5 components. I want to display the all the components names, how will you do that one?

598


What is constructor in java ?

627


Difference between a process and a program?

611


What is Mutex (Mutual Exclusion Object) ?

619






Where pragma is used?

592


What is the role of the java.rmi.naming class?

515


Implement a stack with push (), pop() and min() in O(1) time.

622


Why javac is not recognized?

515


How hashmap increases its size in java?

479


Define class?

512


Why are there no global variables in java?

573


What is nan inf?

501


What is the purpose of static methods and variables?

527


Can an unreferenced object be referenced again?

755