Lecture 21
18
Keyword throws – lawyers at work
•public void doIt( ... )
•  throws JunoException
•{
•   ...
•}
•Since doIt might throw a JunoException it must
–catch it // it doesn’t
–or declare its intention to throw it on up the stack to its caller by asserting throws JunoException
•throws means might throw, not does throw
•Built in Exceptions don’t need a throws clause
•If uncaught they crash the program