Pergunta de entrevista da empresa Mastercard

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