This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
satya mohanty wrote:
1.wht are those last three lines indicate i mean i know am creating threads here but why do i need the 2 statements there.
If you are talking about last two statements (with t2 & t3) then they are creating two threads to run simultaneously. Thread constructor is passed a runnable object (t1 - MyThread) which is what the thread will be executing on.
2.passing object and thread name as parameters wht happens when i m passing a runnable object as parameter.
No problem. Thread has few constructors you can use. If you passed in a name you may identify the thread later easily by name.
3.why is this statement written in MYthread constructor
That thread doesn't do anything here. It's that two threads namely t1 & t2 do the actual job.