PPT Slide
- Results in an error saying that dequeue must catch or declare QueueEmptyException.
- To resolve this, modify dequeue so that the exception is declared to be thrown:
public void dequeue(Object o) throws QueueEmptyException {
throw new QueueEmptyException( );
- The method header above declares that this
method can throw a QueueEmptyException
and that the method calling dequeue( ) must plan
on catching the QueueEmptyException.