|
|
Re: threads..
|
Posted: Jan 15, 2007 6:45 AM
|
|
A Thread is not a method. It does not return anything (except error codes and such stuff). A Thread is however a class and a class can contain methods which can return values. So you have the option to make the run method and the method which returns the value syncronized, which means that one can not be called while the other one is still running. After starting your thread, call the returnValue method. Your program will wait until the Thread has stopped and then get the value from this method. But if you work like that, using a Thread does not make any sense at all.
btw: how do you print out a thread?
|
|