Multiple choice technology programming languages

What is a daemon thread?

  1. main thread is a daemon thread.

  2. garbage collector thread is a daemon thread.

  3. All user defined threads are daemon thread.

  4. None of above.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Daemon threads in Java are low-priority threads that run in the background to perform tasks like garbage collection. The garbage collector thread is indeed a daemon thread because it runs periodically to reclaim memory without requiring explicit program control. The main thread is user-created, not daemon. User-defined threads are daemon only if explicitly marked with setDaemon(true).