
import java.lang.*;
class Current{ public static void main(String ar[]){
Thread t = Thread.CurrentThread(); System.out.println("current thread"+t); System.out.println("thread name"+t.getName());
} } i got error as Current.java:6: cannot find symbol symbol : method CurrentThread() location: class java.lang.Thread Thread t = Thread.CurrentThread(); ^ 1 error pls tell me the reolution...

import java.lang.Thread;
class Current{
public static void main(String ar[]){
Thread t = Thread.currentThread();
System.out.println("current thread"+t);
System.out.println("thread name"+t.getName());
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.