Hi,
Daemon threads are the low priority threads in java. example is garbage collector. I read that only JVM or OS will have control on Daemon threads.
could any body please tell me can we create our own Daemon Threads in java? if yes, how to do it?
Thanks.
--Deepika
The thread class has a convenient method setDaemon(boolean isDaemon).
Not a beginners topic. I will move this thread to a more appropriate forum for you.
Whether or not a thread is a daemon thread is independent of its priority (although it's true that most often they have a low priority). Check the javadocs of the java.lang.Thread class for methods that can be used to set/unset the daemon status of a thread.
All that being a daemon means for a running Thread is that it will not keep the JVM from exiting if there are no other non-daemon threads; no more, no less.