11.07.2015 Views

AP Computer Science Homework Set 11 Exceptions

AP Computer Science Homework Set 11 Exceptions

AP Computer Science Homework Set 11 Exceptions

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7. The Throwable class defines two important methods, getMessage() andprintStackTrace(). Which of the following classes inherit these methods:IOException, InterruptedException, RunTimeException?Answer:8. Search the Java <strong>AP</strong>I the NullPointerException class. List threecircumstances under which this exception be thrown. Give a Java code examplethat would throw this exception under each of these circumstances.Answer:9. Search the Java <strong>AP</strong>I the ClassCastException class. Under whatcircumstance will this exception be thrown? Give a Java code example thatwould throw this exception.Answer:Page 4<strong>AP</strong> <strong>Computer</strong> <strong>Science</strong> – Unit <strong>11</strong> Programshttp://thecubscientist.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!