There is a particular kind of thread called a daemon.
The word daemon has an ancient Greek origin meaning a divinity or supernatural being of a nature between gods and humans and an inner or attendant spirit or inspiring force.
In computer science, the term daemon has more mundane usage and is applied to a computer program that runs as a background process, rather than being under the direct control of an interactive user. That is why there are the following two types of threads in Java:
- User thread (default), initiated by an application (main thread is one such an example)
- Daemon thread that works in the background in support of user thread activity
That is why all daemon threads exit immediately after the last user thread exits or are terminated by JVM after an unhandled exception.