Daemon thread in Java are those thread which runs in background and mostly created by JVM for performing background task like Garbage collection and other house keeping tasks. Difference between Daemon and Non Daemon(User Threads) is also an interesting multi-threading interview question, which 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 thread finish execuction java program or JVM terminates itself, JVM doesn't wait for daemon thread to finish there execution. As soon as last non daemon thread finished JVM terminates no matter how many Daemon thread exists or running inside JVM. In this java thread tutorial we will see example of Daemon thread in Java and some more differences between Daemon and non daemon threads.
Jumat, 16 Maret 2012
core java
What is Daemon thread in Java and Difference to Non daemon thread - Tutorial Example
Read more »
0 Response to "What is Daemon thread in Java and Difference to Non daemon thread - Tutorial Example"
Posting Komentar