File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Custom Exception doubt
Joined: Aug 08, 2009
Sep 14, 2011 12:38:04
can i create a custom exception extending java.lang.Throwable? if yes then why we do it using Exception or RuntimeException. what will be the problem if we do it using Throwable always?
thanks a lot in advance
Joined: Oct 13, 2005
Sep 14, 2011 13:15:28
Because many methods only deal with Exceptions, you will have to introduce special handling for your Throwable subclass. It will count as "checked" of course.
Of course you can subclass Throwable, but that should only be done under the justification of
I only wanted to see what happens if . . .
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Custom Exception doubt
How to throw custom exceptions while implementing Provider
custom DataSource and SourceStream for RTP
Calssic Vs Simple Custom tags
Exception Handling in Tomcat
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014