You are here: Home / Topics / Java Program to use getName( ) and getPriority( ) of Thread

Java Program to use getName( ) and getPriority( ) of Thread

Filed under: Java on 2023-09-22 06:44:52

// Program to use getName( ) and getPriority( )

public class  MainThread
{
   public static void main( String[ ] args )
   {
      System.out.println( " Thread Name = " + Thread.currentThread().getName() );
      System.out.println( " Priority    = " + Thread.currentThread().getPriority() );
   }
}


Output:

Thread Name =  main
Priority    =  5

About Author:
G
Geetam     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.