java thread

Java
public class ClassName extends Thread{
  public void run(){
    super.run();
    //Your Code
  }
}

public class Main{
  public static void main(String[] args){
    ClassName thread = new ClassName();
    thread.start();
  }
}
Source

Also in Java: