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 inputs would be caught by the second catch block in the program in the accompanying figure?
Free
(Multiple Choice)
4.9/5
(42)
Correct Answer:
C
During program execution, if division by zero occurs with integer values and is not addressed by the program, then the program terminates with an error message indicating an attempt to divide by zero.
Free
(True/False)
4.9/5
(38)
Correct Answer:
True
NoSuchElementException is a method of the class Exception.
Free
(True/False)
4.8/5
(38)
Correct Answer:
False
A message is returned by which method of an Exception object?
(Multiple Choice)
4.8/5
(40)
If you have created an exception class, you can define other exception classes extending the definition of the exception class you created.
(True/False)
4.7/5
(34)
Which of the following is NOT a typical action of the catch block?
(Multiple Choice)
4.9/5
(34)
The class Exception and its subclasses are designed to catch exceptions that should be caught and processed during program execution.
(True/False)
4.9/5
(43)
The class RuntimeException is the superclass of which of the following classes?
(Multiple Choice)
4.8/5
(41)
If an exception occurs in a try block and that exception is caught by a catch block, then the remaining catch blocks associated with that try block are ignored.
(True/False)
4.8/5
(33)
A checked exception is any exception checked for by the programmer.
(True/False)
4.7/5
(33)
The StringIndexOutOfBoundsException could be thrown by the method parseInt of the class Integer.
(True/False)
4.8/5
(49)
Which of the following methods prints a list of the methods that were called before the exception was thrown?
(Multiple Choice)
4.8/5
(27)
Which of the following exceptions might be thrown by the methods of the class String?
(Multiple Choice)
4.9/5
(28)
Statements that might generate an exception are placed in a catch block.
(True/False)
4.9/5
(34)
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.8/5
(45)
Which exception-handling technique is the code in the accompanying figure using?
(Multiple Choice)
4.8/5
(40)
Which of the following statements is NOT true about creating your own exceptions?
(Multiple Choice)
4.8/5
(45)
If you have a reference to an exception object, you can use the reference to throw the exception.
(True/False)
4.9/5
(38)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)