线程各属性纵览线程IdID从1开始,JVM运行起来后,我们自己创建的线程的ID早已不是2。 代码演示: [Java] 纯文本查看 复制代码 ? 1 2 3 4 5 6 7 public class Id { public static void main(String[] args) { Thread thread = new Thread(); System.out.println("主线程的ID —— " + Thread.currentThread().getId()); System.out.prin