Exam 11: Handling Exceptions and Events
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of Java50 Questions
Exam 3: Introduction to Objects and Input/output50 Questions
Exam 4: Control Structures I: Selection50 Questions
Exam 5: Control Structures II: Repetition50 Questions
Exam 6: Graphical User Interface GUI and Object-Oriented Design OOD50 Questions
Exam 7: User-Defined Methods50 Questions
Exam 8: User-Defined Classes50 Questions
Exam 9: Arrays46 Questions
Exam 10: Inheritance and Polymorphism50 Questions
Exam 11: Handling Exceptions and Events50 Questions
Exam 12: Advanced Guis and Graphics48 Questions
Exam 13: Recursion50 Questions
Exam 14: Applications of Arrays Searching and Sorting and Strings50 Questions
Select questions type
An exception that can be recognized by the compiler is a(n) ____.
Free
(Multiple Choice)
4.9/5
(30)
Correct Answer:
B
Which class of exceptions is NOT checked?
Free
(Multiple Choice)
4.7/5
(30)
Correct Answer:
C
Which of the following exceptions might be thrown by the methods of the class String?
Free
(Multiple Choice)
4.9/5
(31)
Correct Answer:
A
The class Exception and its subclasses are designed to catch exceptions that should be caught and processed during program execution.
(True/False)
4.7/5
(30)
If there is a finally block after the last catch block, the finally block always executes.
(True/False)
4.8/5
(43)
For interfaces such as WindowListener that contain more than one method, Java provides the class WindowAdapter.
(True/False)
4.8/5
(40)
When an exception occurs in a method, you can use the method printStackTrace to determine the order in which the methods were called and where the exception was handled.
(True/False)
4.8/5
(35)
What happens in a method if there is an exception thrown in a try block but there is no catch block following the try block?
(Multiple Choice)
4.9/5
(35)
Which of the following is NOT a method of the class Throwable?
(Multiple Choice)
4.8/5
(41)
To handle window events, you first create a class that implements the interface WindowListener and then create and register objects of that class.
(True/False)
4.9/5
(31)
Making a reference to an object that has not yet been instantiated would throw an exception from the NullPointerException class.
(True/False)
4.7/5
(41)
The StringIndexOutOfBoundsException could be thrown by the method parseInt of the class Integer.
(True/False)
4.8/5
(33)
Which of the following methods prints a list of the methods that were called before the exception was thrown?
(Multiple Choice)
4.8/5
(32)
If you want to provide your own code to terminate the program when the window is closed, or if you want the program to take a different action when the window closes, then you use the interface ____.
(Multiple Choice)
4.8/5
(42)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)