They say that implementing Runnable is more preferrable than extending Thread. I agree that this is more Java-like.
Ok. I would like to do something like this:
public class HotThread implements Runnable {
...
private void execute() {
if (this.isInterrupted()) {
....
}
}
}
So, now I get an error as there is no method isInterrupted. Could you help me understand this moment: how to use methods of the class Thread within your own class in this case.