International Biometric

  www.biometricgroup.com
  www.biometricgroup.com

Interview Question

Consultant Interview(Student Candidate) New York, NY

What's the difference between the methods sleep() and

  wait()?
Answer

Interview Answer

1 Answer

0

The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.

Interview Candidate on Feb 16, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.