I know that the getName()
function on the main thread will return the String main
, but this can be changed with setName()
.
Is there any way to always determine the main thread of an application?
One possibility is to call Thread.currentThread()
at the start of main()
, and hold on to the reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With