This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 92
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
 
Similar Threads
is the "implement" included in the "is a" relationship?
What exactly is a Marker Interface?
setDaemon
Calling methods before start()
multithreading