Hi,
I just started reading Kathy and Bert's book and was stopped by the same *apparent* (in my mind) contradiction as the person who originally started this topic. I'm just not getting it.
Exerpted from Page 20:
Thread[] threads = new Thread[5];
The key point to remember here is that -- despite how the code appears -- the Thread constructor is not being invoked. We're not creating a Thread instance, but rather a single Thread array object. After the preceding statements, there are still no actual Thread objects!
SNIP
....
SNIP
You can say with certainty, for example, that any code that uses the keyword new will (if it runs successfully) cause the class constructor and all superclass constructors to run.
So why are there no Thread objects created (no Thread constructor called) even though the
new keyword was used?
Is it because in this example
new is being called to create the array and not the threads in the array? If this is the case, then when/how does the Thread constructor run?
I'm confused. If anybody could restate what the book is saying in perhaps a slightly different way, maybe I'll get a clue.
Thanks,
Barron
[ May 09, 2004: Message edited by: Barron Snyder ]