Exam 9: Exception Handling
Exam 1: Getting Started45 Questions
Exam 2: Console Input and Output29 Questions
Exam 3: Flow of Control44 Questions
Exam 4: Defining Classes I45 Questions
Exam 5: Defining Classes II46 Questions
Exam 6: Arrays46 Questions
Exam 7: Inheritance43 Questions
Exam 8: Polymorphism and Abstract Classes43 Questions
Exam 9: Exception Handling45 Questions
Exam 10: File IO46 Questions
Exam 11: Recursion44 Questions
Exam 12: Uml and Patterns22 Questions
Exam 13: Interfaces and Inner Classes32 Questions
Exam 14: Generics and the Arraylist Class32 Questions
Exam 15: Linked Data Structures43 Questions
Exam 16: Collections,maps,and Iterators44 Questions
Exam 17: Swing I37 Questions
Exam 18: Swing II31 Questions
Exam 19: Java Never Ends26 Questions
Exam 20: Applets25 Questions
Select questions type
Define an exception class called NegativeNumberException.The class should have a constructor with no parameters.If an exception is thrown with this zero-argument constructor,getMessage should return "Negative Number Not Allowed!" The class should also have a constructor with a single parameter of type String.If an exception is thrown with this constructor,then getMessage returns the value that was used as an argument to the constructor.
(Essay)
4.9/5
(45)
The compiler does not complain when the catch or declare rule is ignored.
(True/False)
4.9/5
(28)
If you were going to catch an exception of type Exception,where should this catch block be placed within your code?
(Essay)
4.8/5
(36)
When an exception is thrown,the code in the surrounding try block continues executing and then the catch block begins execution.
(True/False)
4.8/5
(42)
Showing 41 - 45 of 45
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)