java program for thread class methods

 public class MyThread

{

public static void main(String ar[])

{

Thread t = new Thread("My First Thread");

t.start();

String str = t.getName();

System.out.println(str);

}

}


OUTPUT



Comments