I just try the code of Nicolas Huet,but I still havin problems
package com.codegym.task.task25.task2510;
/*
Wait and see
*/
public class Solution extends Thread {
Thread myThread = this ;
public Solution() {
myThread.setUncaughtExceptionHandler( new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread myThread, Throwable e) {
if ( e.getCause () instanceof Error) {
System.out.println("Can't keep running");
}
if ( e.getCause () instanceof Exception) {
System.out.println("Needs handling");
}
if ( e instanceof Throwable) {
System.out.println("Wait and see");
}
}
});
}
public static void main(String[] args) {
}
}