PPT Slide
When an exception is thrown, it must be caught immediately or declared to be allowed to propagate.
An example of code that will not compile:
class Queue {
...
public boolean isEmpty( ) {
...
} // isEmpty
public void dequeue(Object o) {
if (isEmpty( ) == true)
throw new QueueEmptyException( );
...
} // dequeue
...
} // class Queue
Exceptions: Propagation
Previous slide
Next slide
Back to first slide
View graphic version