Frage im Vorstellungsgespräch bei Mastercard

What is the difference between the sleep and wait method in java?