Describes the steps to generate programmatic thread dump in Java
import java.io.IOException;
public class Controller {
public static void main(String[] args) throws IOException {
MyThread my = new MyThread();
Thread th = new Thread(my);
th.start();
try {
Thread.sleep(2000);
} catch (Exception e) {
}
}
}