what is the difference between java user thread and daemon thread java interview

preview_player
Показать описание

UPLOAD YOUR RESUME IN 1 MINUTE ! ! !

What is the difference between java thread and daemon thread ? Explain-- Java Interview Questions and Answers.

What is the difference between java thread and daemon thread ? Explain

The difference between user thread and daemon thread is that the JVM exits an application only when all user threads are complete.

The JVM does not care about letting daemon threads complete, so once all the user threads are complete, the JVM will shut down, regardless of the state of any daemon threads.

User thread :
Main()
Daemon thread :
the clock handler thread,
the idle thread,
the garbage collector thread,
the screen updater thread,

How to make a user thread as daemon thread ? setDaemon(true) API

How to identify a thread is daemon thread or not ? You can use "isDaemon()" API

Рекомендации по теме
join shbcf.ru