Friday, January 10, 2014

How to know the current thread of your program?

class Thread4
{
    public static void main(String surat[])
    {
        Thread t=Thread.currentThread();
        System.out.println("My Thread is : "+t);
    }
}

Output:

No comments:

Post a Comment