aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Run method question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Run method question" Watch "Run method question" New topic
Author

Run method question

Dinesh Tahiliani
Ranch Hand

Joined: Aug 06, 2007
Posts: 486
Can we overload or override the run method of thread?
If yes, can you explain me with example please...


Thanks<br />Dinesh
ramesh maredu
Ranch Hand

Joined: Mar 15, 2008
Posts: 210

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.



SCJP 1.5 94%.
The greatest glory in living lies not in never falling, but in rising every time we fall.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Run method question