If you run this program you will see a output like :
$1$ : 4
$1$ : 2
$1$ : 3
$1$ : 1
$2$ : 4
$2$ : 3
$2$ : 2
$2$ : 1
here how it works
First in the main methods for loop on line 19 it's create 2 SimpleThread objects as the for loop counts. And each time SimpleThread object createed it calls SimpleThread objects default constructor on line 4 and store threadCount value as the name by using super constructor on line 5.
Then it's call start method for start the SimpleThread objects
thread execution. when it started it execute the code in run method on line 11. In the run methods while loop counts until countDown variables value become 0.
The countDown variables value check using if statement on line 14 and when it evaluate countDown variable and see countDown == 0 then run method returns(exit).
And also another thing happen always that while loop counts. That is it print this SimpleThread objects
string representation. That String representation is conducted by the toString method. Each time toString method calls it return string object that include this SimpleThread objects name and countDown value. That's all.