This is a good answer, but it would be better if you'd used the word "delegate". The object that you give to the
Thread(Runnable r)
constructor becomes the Thread object's
delegate. The difference between inheritance and delegation is the difference between saying, "A foo is a bar" and saying "a foo
has a bar." The latter form is a much more powerful tool, and programmers should get into the habit of using it. Probably the only reason why
Thread
has a public
run()
method is that delegation had not yet been named as a design pattern when Java first rolled out. —
james large 2 mins ago