Part1 Threading Interview Questions and Answers
1) What is Daemon thread ?
Daemon thread are background threads which are used for background task. JVM do not care for background thread execution. Once all other non Daemon threads completes their executions and JVM ends without caring for the running Daemon threads.One can make a non-daemon thread a daemon thread using the .setDaemon(true) method.
One can check thread is daemon or not using the isDaemon() method.
Mostly JVM creates daemon threads for Garbage collection related background task.