Create and set UncaughtExceptionHandler before starting new thread to catch unexpected runtime exception in Multithreading application. package demo; public class ExceptionHandler { public static void main(String[] args) { Thread thread = new Thread(new Runnable() { @Override public void run() { throw new RuntimeException("Critical Error"); } }); System.out.println("Starting new thread " + Thread.currentThread().getName()); //Throw this exception if any exception has occurred inside running thread but was not cau...
Software Company in Butwal, Nepal.