Implementing Runnable is a way to create threads by defining a run method.
Source Code
public class HelloRunnable implements Runnable {
public void run() {
System.out.println("Hello from a thread!");
}
public static void main(String[] args) {
Thread thread = new Thread(new HelloRunnable());
thread.start();
}
}