Why we call Thread.start() method which in turns calls run method?

后端 未结 12 1145
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 01:40

Why do we call the thread object\'s start() method which in turns calls run() method, why not we directly call run() method?

12条回答
  •  旧时难觅i
    2020-11-29 02:38

    If we want, we can call run() method, but if we call run method it will run as just a normal Java method. Whereas it we call start() it, JVM creates a new thread and run method will be executed on that thread.

提交回复
热议问题