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 Inputoutput50 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 Classes and Adts50 Questions
Exam 9: Arrays50 Questions
Exam 10: Inheritance and Polymorphism50 Questions
Exam 11: Handling Exceptions and Events50 Questions
Exam 12: Advanced Guis and Graphics49 Questions
Exam 13: Recursion50 Questions
Exam 14: Searching and Sorting50 Questions
Select questions type
Which of the following will cause the first exception to occur in the code in the accompanying figure?
(Multiple Choice)
4.9/5
(39)
The JList GUI component generates events that call the actionStateChanged method.
(True/False)
4.7/5
(41)
The order in which catch blocks are placed in a program has no impact on which catch block is executed.
(True/False)
4.8/5
(30)
An unchecked exception is any exception that causes a program to terminate.
(True/False)
4.9/5
(38)
For interfaces such as WindowListener that contain more than one method, Java provides the class WindowAdapter.
(True/False)
4.7/5
(40)
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)
The try block contains statements that should be executed regardless of whether or not an exception occurs.
(True/False)
4.7/5
(28)
If there is a finally block after the last catch block, the finally block always executes.
(True/False)
4.9/5
(41)
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)
5.0/5
(33)
When an exception occurs, an object of a particular exception class is created.
(True/False)
4.9/5
(30)
Which method throws the second exception in the code in the accompanying figure?
(Multiple Choice)
4.9/5
(41)
How many finally blocks can there be in a try/catch structure?
(Multiple Choice)
4.8/5
(35)
To handle window events, if the class containing the application program does not extend the definition of another class, you can make that class extend the definition of the class ____.
(Multiple Choice)
4.8/5
(36)
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
(31)
The methods getMessage and printStackTrace are private methods of the class Throwable.
(True/False)
4.9/5
(43)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)