代码示例:
package com.thb; public class Demo4 { public static void main(String[] args) { ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); System.out.println(threadGroup.getName()); } }
运行输出: