This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Thread.sleep() Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
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://aspose.com/file-tools
 
subject: Thread.sleep() Method