posted 18 years ago
You can only throw checked exceptions from a method if the method declares these exceptions, i.e. :
If you don't declare the method with "throws" you need to handle the exception within the method. This is because checked exceptions exist to allow the compiler to check that they are properly being handled. Basically the possibility the an operation can fail, and an indication of how it might fail is written into the language to force the coder to handle this possibility.
[ January 25, 2007: Message edited by: Paul Sturrock ]