Author | Topic: thread |
Umesh ranch hand |
posted March 11, 2000 03:45 PM
Assume that above code compile free and also assume that a Java application creates a Whiffler object and calls start[/] method, that no other calls to Whiffler methods are made and that the [b]Thread in this object is the only one the application creates. Which of the following are true ? Answer is 2&4.
|
maha anna bartender |
posted March 11, 2000 04:08 PM
The start() method of the Whiffler class just creates a new thread. It is not started yet.In order to start the thread you have call the start() method of the thread ref myT such as myT.start() . Also note that, the public void start() method defined in this Whiffler class is not inherited from Thread class. It's not at all related to starting the thread. It is completely diff. method which happened to have the same name as start() method in Thread class. The Whiffler class is not a thread by itself. It just implements the Runnable interface. regds maha anna
|
Umesh ranch hand |
posted March 11, 2000 04:20 PM
Thanx....Anna!!!(I came to know u r a she!!....then how come ur name in He.....thinking that it is a Indian name)
|
| | |