• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Run method question

 
Dinesh Tahiliani
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we overload or override the run method of thread?
If yes, can you explain me with example please...
 
ramesh maredu
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
run method is also like normal method we can overload and override it,in fact it is already overrided in Thread class, it is actually from Runnable interface.
If we override run method in our class when thread is started it will call our run method,but if we overload it,it will not get called automatically.

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again...
Dinesh, wouldn't it have been faster and more meaningful for you to try do do this in a small program of your own?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic