PPT Slide
This will result in a compile-time error because method getNextCustomer must:
- catch exception QueueEmptyException, or
- declare that QueueEmptyException propagates upwards
Thus, we can repair getNextCustomer in one of two ways:
- Option 1: have it catch exception QueueEmptyException
- Option 2: have it declare that this method allows QueueEmptyException to propagate
Exceptions: Example (cont’d)