设置一个线程为守护线程

线程对象通过调用setDaemon(boolean b)方法来将一个线程设置为守护线程。

如:自定义一个线程SoHuThread(),

// 创建SoHuThread()的对象t

Thread t = new SoHuThread();

// 将t设置为守护线程

t.setDaemon(true);

原文地址:https://www.cnblogs.com/jh5240/p/2368817.html