DEVFYI - Developer Resource - FYI

If I want an object of my class to be thrown as an exception object, what should I do?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

516. If I want an object of my class to be thrown as an exception object, what should I do?

The class should extend from Exception class. Or you can extend your class from some more precise exception type also.

(Continued on next question...)

Other Interview Questions