Java runnable is an interface used to execute code on a concurrent thread. It is an interface which is implemented by any class if we want that the instances of that class should be executed by a thread.
public class ExampleClass implements Runnable {
@Overridepublic void run() {System.out.println("Thread has ended");}public static void main(String[] args) {ExampleClass ex = new ExampleClass();Thread t1= new Thread(ex);t1.start();System.out.println("Hi");}
}


