Hi Ranchers,
I understand the process like ::
1.Create the Runnable Object ……
2.Create a
Thread instance & give it your target Runnable created.
3.Now when we invoke start() on Thread instance it’ll invoke run method of target runnable.
But in above example as we created a Thread instance at (a),(b) & given it a Runnable created.When we invoked start method on different Threads created , (a) & (b) are calling
Their own (Thread subclass) methods instead of Target Runnble’s run() method (irrespective of line 1 or 2 is commented at a time).
Why they are calling thir own class’ run() method ???
Whereas if we use statement
Thread ob = new Thead(rd);
Ob.start();
Will call the run() method of target Runnable .In this case why not Thread class’ run() method called(which does nothing) ???
I am in big confusion please help me.
Thanks & Regards
(attempted formatting code)
[ October 03, 2006: Message edited by: Barry Gaunt ]