Two Laptop Bag
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Run method question" Watch "Run method question" New topic

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

Joined: Dec 11, 2004
Posts: 13410

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
I agree. Here's the link:
subject: Run method question
jQuery in Action, 3rd edition