In java we call Thread.sleep(10000) to interrupt a thread , and if we call wait then until we call notify() the Thread sleeps.But recently i went through an article which says we can pass parameter into wait().So if we can pass it and make it wait for the scheduled time , then what is the difference between Thread.sleep(1000) and connections.wait(3000).Below is the link i have went through
https://www.javamex.com/tutorials/synchronization_wait_notify_2.shtml
Can anyone please explain this situation ? I am really confused.