What is Daemon thread in Java and Difference to Non daemon thread - Tutorial Example
Daemon thread in Java is those thread that runs in the background and is mostly created by JVM for performing background tasks like Garbage collection and other housekeeping tasks. The difference between Daemon and Non-Daemon (User Threads) is also an interesting multi-threading interview question, which is asked mostly on fresher level java interviews. In one line main difference between daemon thread and user thread is that as soon as all user threads finish execution java program or JVM terminates itself, JVM doesn't wait for daemon thread to finish their execution.
تعليقات
إرسال تعليق