| Author |
doubt in sleep() method
|
manas ranjan mandal
Ranch Hand
Joined: Apr 02, 2008
Posts: 97
|
|
why sleep() method in Thread class is static?why is the reason behind to made is a static method? thanks in advance
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32599
|
|
|
Presumably so you can access it without knowing the name of the thread you are running on.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16479
|
|
|
If it were an instance method then you could cause other threads to sleep, by calling their sleep() method. That would be a bad thing.
|
 |
 |
|
|
subject: doubt in sleep() method
|
|
|