aspose file tools
The moose likes Beginning Java and the fly likes Thread.sleep() Method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Thread.sleep() Method" Watch "Thread.sleep() Method" New topic
Author

Thread.sleep() Method

Thomas Markl
Ranch Hand

Joined: Mar 08, 2001
Posts: 192
Why does this compile (Thread.sleep())???


And this (sleep() )doesn’t compile:
[ edited to correct formatting -ds ]
[ September 07, 2002: Message edited by: Dirk Schreckmann ]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Because sleep() is a static method of the Thread class. TestMyThread7 does not extend the Thread class nor does it have its own sleep() method so it fails to compile.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Thread.sleep() Method
 
Similar Threads
syncronizing run() method
synchronized method
Daemon Thread
Thread class join() method
join() method; guarenteed behaviour