Lecture-29 - Types of Exceptions There are two types of exceptions – Checked – Unchecked A checked exception is an exception that is checked at

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Object Oriented Programming Java - Exceptions & Assertions R.B. Lenin Winter 2006 DA-IICT 55 Types of Exceptions There are two types of exceptions: – Checked. – Unchecked. A checked exception is an exception that is checked at compile time. All other exceptions are unchecked , or runtime, exceptions . As the name suggests, they are detected only at runtime.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming Java - Exceptions & Assertions R.B. Lenin Winter 2006 DA-IICT 56 Types of Exceptions If a method is a propagator of checked exceptions, the method must have the throws clause. When calling a method throws checked exceptions, use the try-catch statement and place the call in the try block, or modify the method header to include the appropriate throws clause.
Background image of page 2
Object Oriented Programming Java - Exceptions & Assertions R.B. Lenin Winter 2006 DA-IICT 57 Types of Exceptions If a method is a propagator of runtime exceptions or errors, the throws clause is optional.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Oriented Programming Java - Exceptions & Assertions
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/15/2010 for the course CSE IT115 taught by Professor Rblenin during the Spring '10 term at Punjab Engineering College.

Page1 / 12

Lecture-29 - Types of Exceptions There are two types of exceptions – Checked – Unchecked A checked exception is an exception that is checked at

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online