Java tutorial
class MyThread extends Thread { MyThread() { setDaemon(false); } public void run() { boolean d = isDaemon(); System.out.println("daemon = " + d); } } public class Main { public static void main(String[] args) throws Exception { Thread thread = new MyThread(); System.out.println("thread = " + thread.currentThread()); thread.setDaemon(false); thread.start(); } }