Forums Register Login

Call Overload Version of Thread's run method

+Pie Number of slices to send: Send
Hi,

The Thread class expect a run() method (no arguments), but how can I let it call a overload method? like run(MyClassName aClass)

Regards,

Lennie
+Pie Number of slices to send: Send
well you can create your own overloaded method.


but how you will tell to thread.start() to execute my own overloaded run method??
by default thread.start() will execute no-arg run() method!

+Pie Number of slices to send: Send
you have to call overloaded run method on that particular object. it can be done in run() method which the thread recognizes.
+Pie Number of slices to send: Send
yeah you are right rushikesh sawant. now it will become any normal void method
+Pie Number of slices to send: Send
Something like this may do what you want:
"Don't believe every tiny ad you see on the internet. But this one is rock solid." - George Washington
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1579 times.
Similar Threads
I thought of a NullPointerException??
Run method question
Question about equals! help
runnable
run() method
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:35:52.