Write a program in java to demonstrate Thread?

class ThreadTest

{

      static

      {

            Thread t=Thread.currentThread();

            System.out.println("Name of current thread "+t.getName());

            System.out.println("Priority of thread is "+t.getPriority());

      }

      public static void main(String arg[])

      {

            System.out.println("main() is started");

      }

}

Thread.PNG

, , , , ,

Leave a Reply