Thursday, March 5, 2015

Set Thread Name in a java pgm



Set Thread Name

public class SetThreadNameExample
{
public static void main(String[] args)
{
Thread currentThread = Thread.currentThread();
System.out.println(currentThread);
currentThread.setName("Set Thread Name Example");
System.out.println("Thread Name : "+ currentThread.getName());
   }
}

No comments:

Post a Comment