This is because whenever you are calling these methods, those are applied on the same thread that is running.
You can't tell another thread to perform some operation like, sleep()
or wait
. All the operation are performed on the thread which is being executed currently.