{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture-28 - Propagating Exceptions When a method may throw...

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 40 Propagating Exceptions When a method may throw an exception, either directly or indirectly, we call the method an exception thrower . Every exception thrower must be one of two types: – catcher. – propagator.
Background image of page 1

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

View Full Document Right Arrow Icon
Object Oriented Programming Java - Exceptions & Assertions R.B. Lenin Winter 2006 DA-IICT 41 Propagating Exceptions An exception catcher is an exception thrower that includes a matching catch block for the thrown exception. An exception propagator does not contain a matching catch block. A method may be a catcher of one exception and a propagator of another.
Background image of page 2
Object Oriented Programming Java - Exceptions & Assertions R.B. Lenin Winter 2006 DA-IICT 42
Background image of page 3

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

View Full Document Right Arrow Icon
Object Oriented Programming Java - Exceptions & Assertions R.B. Lenin Winter 2006 DA-IICT 43 Propagating Exceptions If a method is an exception propagator, we need to modify its header to declare the type of exceptions the method propagates.
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.

{[ snackBarMessage ]}