public class test1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Thread t = Thread.currentThread();
System.out.println(t);
}
}
Why the output of above code is - Thread[main,5,main] ? Please Explain
Because
thread.toString()
returns a string representation of this thread, including the thread's name, priority, and thread group.Because of:
Source: https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#toString()