笔记地址:
博客地址:
Juc_并发编程目录_https://tangzhi.blog.csdn.net/article/details/1092_所得皆惊喜的博客-CSDN博客
- package com.nanjing.gulimall.zhouyimo.test;
-
- import java.util.concurrent.TimeUnit;
-
- public class DaemonDemo {
- public static void main(String[] args) {
- Thread t1 = new Thread(() -> {
- System.out.println(Thread.currentThread().getName() + " 开始运行," + (Thread.currentThread().isDaemon() ? "守护线程" : "用户线程"));
- while (true) {
-
- }
- }, "t1");