Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Threads Doubt  RSS feed

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



OUTPUT-Inside Thread's subclass
possible reason for this beahviour(Correct me If I am wrong):
In the start function, from where run is called there is no information about the implementer of Runnable created?
OR
The run() inside the Thread's subclass is overriding the Runnable implementer's run?But how can Thread's subclass overrides Runnable implementer's run?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a look in the Source Code of the Class Thread you see following method:



Since you override run() this code won't ever be executed. Instead your run method is called and print yout defined output
 
Gari Jain
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it.

Thankx a lot.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!