Java ThreadGroup.toString()
Syntax
ThreadGroup.toString() has the following syntax.
public String toString()
Example
In the following code shows how to use ThreadGroup.toString() method.
//w ww . j a v a 2 s. c om
public class Main {
public static void main(String[] args) {
ThreadGroup group = new ThreadGroup("admin");
Thread t = new Thread(group, "website");
System.out.println("Threadgroup = " + group.getName());
String str = group.toString();
System.out.println(str);
}
}