In computer science, a thread of execution is the smallest sequence of programmed instructions
Wikipedia
public Runnable task = new Runnable() {
    @Override
    public void run() {
        System.out.println("I'm in a separate thread");
    }
};
public void onButtonClick() {
    task.run();  
};an API that allows Web application authors to spawn background workers running scripts in parallel to their main page
W3C