public class Test1 {
public static void main(String[] args) {
Thread currentThread = Thread.currentThread();
System.out.println(currentThread.getName()); // 获取线程名字
currentThread.setName("hello world"); // 设置线程名字
System.out.println(currentThread.getName());
}
}