Running Thread by calling start() and run(), what is the difference?

后端 未结 7 1651
粉色の甜心
粉色の甜心 2020-12-07 04:00

It may be a basic question, i was confused with this,

in one file i have like this :

public class MyThread extends Thread {
    @Override
    public          


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 04:40

    • run() method after calling start() : this is executed by your thread which is created by you, it is allocated processor to run independently.

    • run() method called by you : executed from your calling thread.

提交回复
热议问题