There are more threads in any given
Java application than you control. There is a thread for garbage collection, for example, as well as other ones for control and communications with the
IDE and debuggers. You have no control over these threads, and you have no control over the names of threads in the default thread group - so you shouldn't rely or expect anything regarding those thread names. The fact that you get Thread-1 and Thread-3 is a product of your environment, and would be different if running in a different IDE or a different runtime or OS. If you really need to rely and control thread names
you should create a ThreadGroup to create your Threads in, so their names are in your control, and not influenced by threads outside your group.
Edit:
Actually, the ThreadGroup isn't enought to get reliable names, but it is enough to get a list of your threads without interference. To get control of the Thread names you need to use the Thread constructors which provide a name for the Thread. Perhaps the best way to repeatedly generate these threads would be to implement a ThreadFactory...