PPT Slide
- In Java, there are actually two types of Exceptions:
- those subclassed from Exception
- those subclassed from RuntimeException
A technoid annoyance: Both kinds deal with run-time errors
- Those subclassed from RuntimeException do not have to be explicitly caught or declared in the method header.
- This is good. It prevents code from being cluttered with exception handling:
// possible ArrayIndexOutOfBounds
customerArray[10] = new Customer( );
// possible ArithmeticException
- These may still be caught and/or propagated
upwards like normal exceptions.
Exception & RuntimeException