Exam 12: Exception Handling
Exam 1: Creating Your First Java Classes76 Questions
Exam 2: Using Data81 Questions
Exam 3: Using Methods, Classes and Objects79 Questions
Exam 4: More Object Concepts84 Questions
Exam 5: Making Decisions80 Questions
Exam 6: Looping77 Questions
Exam 7: Characters, Strings and the Stringbuilder82 Questions
Exam 8: Arrays77 Questions
Exam 9: Advanced Array Concepts80 Questions
Exam 10: Introduction to Inheritance78 Questions
Exam 11: Advanced Inheritance Concepts78 Questions
Exam 12: Exception Handling79 Questions
Exam 13: File Input and Output78 Questions
Exam 14: Introduction to Swing Components79 Questions
Exam 15: Using Javafx and Scene Builder65 Questions
Select questions type
The example code above depicts a try block and a catch block. Describe how the try and catch blocks operate when illegal integer division is attempted. Describe what will happen if valid values are entered.

(Essay)
4.9/5
(34)
An alternative to hard coding error messages into your Exception classes is creating a catalog of possible messages to use. What are the advantages of doing so?
(Essay)
4.9/5
(44)
Match each term with the correct statement below.
Premises:
Any process crucial to an organization
Responses:
mission critical.
Throwable
Exception(String message)
Correct Answer:
Premises:
Responses:
(Matching)
5.0/5
(47)
Match each term with the correct statement below.
Premises:
List of methods called during program execution
Responses:
exception handling
mission critical
syntactic salt
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(44)
In the above code, explain the importance of the shaded statement. What occurs if the statement is commented out of the program?

(Essay)
4.7/5
(37)
Match each term with the correct statement below.
Premises:
The parent class of Exception
Responses:
Exception(String message)
Exception(Throwable cause)
stack trace.
Correct Answer:
Premises:
Responses:
(Matching)
5.0/5
(32)
Match each term with the correct statement below.
Premises:
Errors occurring during program exceution
Responses:
syntactic salt
assert statement
mission critical
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(33)
If you want to ensure that a user enters numeric data, you should use ____ techniques that provide the means for your program to recover from the mistake.
(Multiple Choice)
4.9/5
(35)
Match each term with the correct statement below.
Premises:
Indicates that a different method will catch the exception
Responses:
exception handling
Exception(Throwable cause)
mission critical
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(36)
public static void main(String args[])
{
int a, b;
try
{
a = 0;
b = 42 / a;
System.out.println("This will not be printed.");
}
catch (ArithmeticException e)
{
System.out.println("Division by zero.");
}
System.out.println("After catch statement.");
}
The program above includes a try block and a catch clause that processes the ArithmeticException generated by the division-by-zero error. Explain how the try and catch blocks operate, and what the output will be following program execution.
(Essay)
4.8/5
(43)
Programs would be less clear if you had to account for ____ exceptions in every method declaration.
(Multiple Choice)
4.8/5
(37)
____ exceptions are the type that programmers should anticipate and from which programs should be able to recover.
(Multiple Choice)
4.9/5
(40)
Unplanned exceptions that occur during a program's execution are also called execution exceptions.
(True/False)
4.9/5
(36)
When you have actions you must perform at the end of a try…catch sequence, you can use a ____ block.
(Multiple Choice)
4.7/5
(32)
A(n) ____ statement is one that sends an Exception object to a catch block.
(Multiple Choice)
4.9/5
(34)
Match each term with the correct statement below.
Premises:
Constructs a new exception with the specified detail message
Responses:
throws clause.
syntactic salt
mission critical.
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(38)
Showing 21 - 40 of 79
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)