public class ExceptionA extends Exception {
}
public class ExceptionB extends ExceptionA {
}
public class ExceptionTest {
public static void main(String[] args){
try{
throw new ExceptionB();
}catch (ExceptionA e){
System.out.println("ExceptionA");
}catch (Exception e){
System.out.println("Exception");
}
}
}