Skip to content

RunnableExample

Demonstrates thread creation using Runnable interface.

Usage

    Thread t = new Thread(new MyRunnableTask());
    t.start();

MyRunnableTask

Task implementation using Runnable.

class MyRunnableTask implements Runnable {

    @Override
    public void run() {
        System.out.println("Thread running using Runnable.");
    }
}