This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread - run() constructor 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 "Thread - run() constructor " Watch "Thread - run() constructor " New topic
Author

Thread - run() constructor

Rashid Ali
Ranch Hand

Joined: Jan 16, 2001
Posts: 349
Can an argument be passed to run() method of thread like run( int i ) and through which method the value can be passed to its variable i because we don't call thread method run() instead it is called through start() method.
Here is the scenario:
class A implements Runnable and it's initialized in class Thread's constructor with the value of argument declared in run(int i) method.
Please clarify.
thanks and best regards
Rashid Ali
anand raman
Ranch Hand

Joined: Jun 06, 2001
Posts: 66
hi
You cant pass in a parameter to the run method, because if you do so in the code, you will end up overloading the method rather than overriding it.
-Anand
Rashid Ali
Ranch Hand

Joined: Jan 16, 2001
Posts: 349
Thanks very much for your quick reply.
It suffice my querry.
Kind regards
Rashid Ali
 
Have you checked out Aspose?
 
subject: Thread - run() constructor
 
It's not a secret anymore!