Basically, runnable is an interface that is present in the thread and lets the thread what it supposed to do. You can take the below code snippet as a reference:
public class MyRunnableTask implements Runnable {
public void run() {
// do stuff here
}
}
I hope this will help.
Want to know more about Java? Prefer this tutorial on Learn Java.
Want to become a Java Expert? Join Java Training now!!