How to Get Current Thread Name using Java

  1. public class ThreadName   
  2. {  
  3.     public static void main(String[] args)   
  4.     {  
  5.         //* gives current thread name  
  6.         Thread currentThread = Thread.currentThread();  
  7.   
  8.         System.out.println(currentThread);  
  9.     }  
  10. }  
Thank you, keep learning and sharing