i thought the program would fail compiling as we can not invoke run()method directly. but it works fine. WHY? I would appreciate if someone explains me. thanks. [ July 29, 2003: Message edited by: Namaste Sathi ]
Joined: Aug 20, 2001
There's nothing preventing you from calling run: it is delared as public. The Thread class's run method does nothing (unless it was created with a Runnable object); but in your subclass here, it does do something.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Joined: Oct 26, 2002
Joel, so it's not necessary true that we can't invoke run() method of a Thread directly. And also, we can't predict when the run()method gets excuted once the start() is invoked. right?
Joined: May 05, 2000
If you invoke the run() method then it is not running as a separate thread. run() is no different than any other method when invoked that way.