File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes setDaemon not present in Runnable Interface 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 » Threads and Synchronization
Bookmark "setDaemon not present in Runnable Interface" Watch "setDaemon not present in Runnable Interface" New topic
Author

setDaemon not present in Runnable Interface

Santosh Kumar Nayak
Ranch Hand

Joined: Aug 02, 2011
Posts: 93
Why the setDaemon() is not present when we implement the Runnable Interface.

The method is only present when we extend the Thread class.
Sergey Korytnikov
Greenhorn

Joined: Sep 14, 2013
Posts: 10

Because Runnable has nothing to do with threads, it's just an interface with run() method, which is assumed to be executed by thread.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: setDaemon not present in Runnable Interface