Saved Bookmarks
| 1. |
What is exceptional handling ? Also, state the purpose of finally block in a try catch statement. |
|
Answer» Exceptional Handling : A Java exception is an object that describes an exceptional (that is error) condition that has occurred in a piece of code. When an exceptional condition arise, an object representing that exception is created and thrown in the method that caused the error. The method may choose to handle the exception itself, or pass it on. Java exception handling is managed via five keywords. try, catch, throws and finally. Any code that absolutely must be executed after a try block completes is put under finally block. |
|