获取线程名称的两种方式

it2024-10-12  51

1: getName() 获取线程名称,一般用于继承了thread 2: Thread.currentThread().getName() 通过 静态方法 currentThread() 获取当前线程对象 再获取名称

最新回复(0)