The Runnable
interface should be implemented by any class whose instances are
intended to be executed by a new thread. All that is required of such a class is that
it implement a method of no arguments called run
.
public interfaceRunnable
{ public abstract voidrun
(); }
20.19.1 public abstract void run()
The general contract of the method run
is that it may take any action whatsoever.
If an object implementing interface Runnable
is used to create a thread (§20.20), then starting the thread will (normally) lead to the invocation of the object's run
method in that separately executing thread.