Java Reference
In-Depth Information
Here,
name
is the name of the thread.
5.
Change
run( )
so it calls
getName( )
directly, without qualifying it with the
thrd
vari-
able. It should look like this:
6.
Here is the completed program that now extends
Thread
rather than implementing
Runnable
. The output is the same as before.