Runnable.run() has the following syntax.
void run()
In the following code shows how to use Runnable.run() method.
//from w ww. j a v a2 s . co m class caller implements Runnable { String msg; public caller(String s) { msg = s; new Thread(this).start(); } public void run() { System.out.println("run"); } } public class Main { public static void main(String args[]) { new caller("Hello"); } }
The code above generates the following result.