Reputation: 1
What is difference between
thread.sleep(5000);
and
TimerThread.sleep(5000);
in java
Thanks
Upvotes: 0
Views: 1989
Reputation: 6738
TimerThread extends Thread. So Thread.sleep(5000) and TimerThread.sleep(5000) is not different.
Upvotes: 0
Reputation: 500257
If we're talking about this TimerThread
, then there is no difference. The two ways to call sleep()
resolve to the same method (Thread.sleep()
).
I would expect this to be the case for any other reasonable class that extends Thread
. However, if in doubt, one can always check the source code for the class in question.
Upvotes: 2