posted 20 years ago
As a static method, it's good coding practice to call sleep() from the parent class Thread, but this is not required.
EXAM TIP: Note that sleep always executes on the currently running Thread. So when sleep() is called using a specific instance of Thread, it can be misleading. For example, if you have two Threads, t1 and t2, and within t1 is the statement, t2.sleep(), then it might appear that t2 is being put to sleep. But actually, the current Thread (t1) is put to sleep -- it just happened to call the static sleep() method from another instance.
[ September 16, 2004: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org