public class UncaughtExceptionTest1 { public UncaughtExceptionTest1() { Thread thread = new Thread(new Task()); thread.start(); try { while (true) { Thread.sleep(10000L); } } catch (InterruptedException ex) {} } class Task implements Runnable { public void run() { try { Thread.sleep(1000L); } catch (InterruptedException ex) {} throw new RuntimeException(); } } public static void main(String[] args) { new UncaughtExceptionTest1(); } }