Subject: clarification of exceptions

From: Kenneth Been <[email-masked]>
Date: Thu, 19 Nov 1998 16:29:45 -0500 (EST)

Let me clarify my previous message about exceptions.

When you do the i/o methods, such as creating a URL and reading an
input stream, you must catch the exceptions that the system throws,
like I did in the example.  I don't think there is any way to avoid
that.

You do not, however, have to invent any new kinds of exceptions.  You
do not have to throw any exceptions.  None of the methods in your
PriorityQueue interface has to throw exceptions.

When I said that you don't have to do error checking, I meant that in
the insertItem() and removeMinElement() methods you don't have to
check for heap overflow or underflow---situations that would normally
be handled with an exception.  But then in other parts of your program
of course you must make sure that those methods are called properly,
so that the heap doesn't overflow or underflow.

Ken