I think the emphasis of this rule was itself confused. The title addressed the `Runnable` but the description was about the class that created an instance of a vacuous `Runnable`. I've updated the description and code samples to move the emphasis to the empty `Runnable`. Please let me know if you feel changes are still needed.
\[~ann.campbell.2], there are two ways to implement a thread :
____
One is to declare a class to be a subclass of Thread. This subclass should override the run method of class Thread. An instance of the subclass can then be allocated and started
The other way to create a thread is to declare a class that implements the Runnable interface. That class then implements the run method. An instance of the class can then be allocated, passed as an argument when creating Thread, and started
____
In term of separation of concerns, the second approach is definitely the best one. Moreover with this second approach it's simply impossible to forget to implement the run() method whereas when extending the Thread class, nothing compel you to override the Thread.run() method.
=== on 14 Oct 2014, 20:25:42 Freddy Mallet wrote:
I'm sorry @Ann, but I'm going to rework this rule.