How a run() method is called when we extend Thread class

前端 未结 3 1172
广开言路
广开言路 2020-12-11 13:07

While going through the source code of java.lang.Thread class. Curiously I wanted to see how a run() method (user defined run()) is called by Threa

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 13:57

    In start() method- underlying runtime object run() method is going to get called within start() method. And here underlying runtime object is HelloThread class object. Thats why run() method of HelloThread is called.

提交回复
热议问题