If you are looking for own customized exception for your application. You can extend the respective Exception class and call Super constructors and usally override the methods available in Exception (getCause() and getException() methods).
To your information, all exceptions in Java are extened from java.lang.Exception. For example java.lang.ClassNotFoundException is extended from java.lang.Exception.
Another one, java.sql.BatchUpdateException is extended from java.sql.SQLException and SQLException has java.lang.Exception as its Base class.
and to your question why use wrapped Exception ?? It is to localize the exception for a specific Code, Application or API. Also, it provides more information about, and helps in identifying, where the exception has occured.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop