线程的默认命名

package service;

import java.util.stream.IntStream;

/**
* @description:
* @author:
* @create:
**/

public class ThreadDefaultName {
public static void main(String[] args) {
IntStream.range(0, 5).boxed().map(i -> new Thread(
() -> System.out.println(Thread.currentThread().getName())
)).forEach(Thread:: start);
}
}
posted @ 2018-08-14 11:08  深渊中的鱼  阅读(553)  评论(0编辑  收藏  举报