The compiler informs you, in the case of "Checked" exceptions, if you do not enclode your code withing a try/catch block that catches the appropriate exception or it's superclass. Or fi you do not indicate that your method throws the exception or it's superclass. It is not a requiremen that you catch the other exceptions. You can check the API for more details.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
The Java APIdocumentation tells about all the possible exceptions thrown by methods. However these are all checked exceptions, means that they will be checked at compile time. However the rumtime exceptions such as NullPointerException should be handled separately, unfortunately these are not available in API documentation.
Originally posted by Tasty Bread Products Inc.: How do you know which exception(s) your methods should throw? Is there documentation and/or guidelines for this available as part of Sun's SDK?
[ January 16, 2002: Message edited by: sreenivasa majji ]
You can get a complete list of all the runtime exceptions by checking the Throwable \ Exceptions \ RuntimeExceptions hieratchy in the API. java.lang package also lists all the exceptions and errors included in the package. HTH