简体   繁体   中英

Anonymous Class and Anonymous Thread

What is the difference between anonymous (class and thread) and normal class/ thread? Could we track which thread if its anonymous in multi threading?

Thanks

An anonymous class of Thread is an anonymous class of the Thread class. That's all.
It has no relation with the fact the thread is visible and identifiable in the scope of the application.

For example, here t is a Thread instance identifiable (it is a Thread object and it has a name) and so trackable :

Thread t = new Thread("myThread"){
        @Override
        public void run() {
          ...
        }       
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM