05 Exception Handling Flashcards
What exception is used when accessing an invalid index (character) of a string?
StringIndexOutOfBoundsException
Exceptions that occur during execution.
Unchecked exceptions
What exception is used when the class is not found?
ClassNotFoundException
It contains statements which are executed whether or not an exception is thrown.
finally block
Exceptions that occur during compilation.
Checked exceptions
What exception is used when accessing an invalid index of the array?
ArrayIndexOutOfBoundsException
What exception is used when there is an error, such as an integer divided by 0?
Arithmetic Exception
It is created by extending the Exception class.
user-defined exception
There can be multiple catch blocks. True or False?
True
It is the process used to change the normal flow of code of execution if a specifies exception occurs.
Exception handling
It sends an exception out of a block or a method so it can be handled elsewhere.
throw statement
What exception is used when there is an invalid conversion of a string to a numeric format?
NumberFormatException
What exception is used when entering a value that does not match the expected data type?
InputMismatchException
It is a block of code that might throw an exception that can be handles by a matching catch block.
Try block
What exception is used when the access to a class is denied?
IllegalAccessException
There can be multiple finally blocks after a try-catch structure. True or False?
False.
It is a method that can be used to determine Java’s message about the exception.
getMessage()
What exception is used when a requested method does not exist?
NoSuchMethodException
It is an event that occurs during the execution of a program that disrupts the normal flow of instruction.
Exception
It is a segment of code that can handle an exception that might be thrown by the try block that precedes it.
Catch block
What exception is used when there is an invalid use of a null reference?
NullPointerException
What exception is used when the attempt to create an object of an abstract or an interface?
InstatiationException
Assigning a value to an array index that does not match the expected data type.
ArrayStoreException