方法 | 说明 |
public static Thread currentThread(); | 返回当前线程对象的引⽤ |
这个方法我们在多线程的学习中见过很多次,已经非常熟悉了!!!
public class ThreadDemo {
public static void main(String[] args) {
Thread thread = Thread.currentThread();
System.out.println(thread.getName());
}
}