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);
   }
}




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable