我知道getName()主线程上的函数将返回字符串main,但这可以改变setName().
getName()
main
setName()
有没有办法始终确定应用程序的主线程?
一种可能性是致电Thread.currentThread()开始时main(),并保留参考。
main()