Exception Handling


Exception handling allows you to recover from errors that might occur while your program is running. The C language has no built-in exception handling. If you want exception handling in a C program, you have to do it yourself. User -defined exception handling usually involves a potentially complicated series of if-then statements and user-defined error codes. The exception handling generally has to take place where the exception occurs. In a C program you cannot easily pass the exception handling off to another part of the code.

Exception handling is a part of the Java language. There are a series of classes and programming constructs that allow you to easily build exception handling capabilities into your Java program. You can define your own exception classes for any unique needs that your program might have. Blocks of code are used to catch and process exceptions. What's more, the exception handling can be passed on to another part of the program. The exception handling does not have to be performed where the exception occurs.



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net