posted 16 years ago
Yes, it is confusing.
Here are some things to think about:
1. When you do start(), that actually means this.start(). What this means is that the current class must have a start() method (which all Thread instances have.) If you call start() in the code for a class which doesn't have a start() method you will get a compiler error.
2. You can only call java.lang.Thread.start() once on a given Thread instance, or you will get an IllegalThreadStateException What that means is that when you call start() within the code of a subclass of Thread, the call itself must take place in a thread other than the one that you are attempting to start. In other words, you are calling code inside a Thread class from a thread of execution that must be different than the thread of execution originated by the start() invocation. It also means that once the thread is alive, it can't call the start() code again or it will throw the exception (of course, you could always catch the exception and do something with it.)
I hope this didn't make things even more confusing!
All code in my posts, unless a source is explicitly mentioned, is my own.