10.2 Recognizing Exception Classes Flashcards
1
Q
What are the three key groups of exceptions in Java?
A
Error
UnCheckedException(RuntimeException)
CheckedException
2
Q
ποΈ What is an UncheckedExceptions?
A
- > Unchecked exceptions are RuntimeExceptions or any of its subclasses
- > Exceptions that do NOT have to be anticipated (This is declared or handled)
- > They can be thrown by the programmer or the JVM.
3
Q
ποΈ What are some common RuntimeException classes?
A
o ArithmeticException o ClassCastException o IllegalArgumentException βββ NumberFormatException o IndexOutOfBoundsException βββ ArrayIndexOutOfBoundsException o NullPointerException
4
Q
ποΈ What are checked exceptions?
A
- > CheckedExceptions is any Exception that is not a RuntimeException
- > CheckedExceptions are checked at compile-time, this is it must be caught or declared
5
Q
ποΈ What are some common checked exceptions?
A
o CloneNotSuportedExcetion o InterruptedException o IOException o ReflectiveOperationException o SQLException
6
Q
ποΈWhat is an Error βexceptionβ?
A
- > Error means something went so horribly wrong that your program should not attempt to recover from it.
- > They are thrown by the JVM and should NOT be handled or declared.
7
Q
ποΈ What are some common Error βexceptionsβ?
A
o AssertionError o LinkageError βββ ExceptionInInitializerError o ThreadDeath o VirtualMachineError βββ InternalError βββ OutOfMemoryError βββ StackOverflowError βββ UnknownError