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

Q

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

✍: Guest

A

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

2013-05-30, 1956👍, 0💬