What are the considerations of the java daemon thread
In this article, the editor introduces in detail "what are the matters needing attention of the java daemon thread", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "what are the matters needing attention of the java daemon thread" can help you solve your doubts.
Matters needing attention
1. The daemon thread's setting setDaemon (true) must first be placed before start (), otherwise the program will make an error.
two。 All child threads created in the daemon thread are daemon threads.
Using the jojn () method, regardless of whether the thread is a user thread or a daemon thread, it waits for a thread to finish.
Example
Public static void main (String [] args) throws InterruptedException {Thread thread = new Thread (new Runnable () {@ Override public void run () {for (int I = 1; I)