Java Thread.run()
Syntax
Thread.run() has the following syntax.
public void run()
Example
In the following code shows how to use Thread.run() method.
/*from w w w .ja va 2 s . c o m*/
public class Main {
public static void main(String args[]) {
Thread t = new Thread(new ThreadDemo());
System.out.println("thread = " + t);
t.start();
}
}
class ThreadDemo implements Runnable {
public void run() {
System.out.println("Inside run()function");
}
}