Table of Contents

Java - Runnable

About

A Runnable is a configuration object that define the code that will run inside threads. See example

Example

public class HelloRunnable implements Runnable {

    public void run() {
        System.out.println("Hello from a thread!");
    }

    public static void main(String args[]) {
        (new Thread(new HelloRunnable())).start();
    }

}