This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Try block (1): • The code that could potentially generate an error is placed in this block Catch block (1): • Encapsulates that code responsible for error/exception handling Throw (1): • Manually throw exceptions that have been defined by the user, Alls partial processing of the error and throws back to the caller method Finally (2): • Always Executed • Opend resources are closed • Appears after the last catch block • Will not execute if Syste.exit(0) executes first Throws (1): • Throws the error for handling to caller • Throws clause at a class leve (caller class) 9. Is it possible to writemultiple catch blocks? If yes describe the most effective way of writing it. (2 marks) Yes it is. Write mst specific exception catch block first and end with the most general one. – Fail first approach....
View Full Document
This note was uploaded on 05/09/2010 for the course CS CS300 taught by Professor Abh during the Spring '10 term at lln.
- Spring '10