I have read one thing about threads in the Java thread model API. It says that more than one thread can have the same name. But the PID of each thread will be unique, right? What is the name then? Is not the thread class name?
I have read one thing about threads in the Java thread model API. It
Share
The name is whatever you set it to be using
Thread.setName. It’s just for the purpose of diagnostics. If you don’t callThread.setNameor provide the name to the constructor, the value will be determined as per the docs:(It’s obviously more useful diagnostically to give a specific thread name which indicates its purpose.)