Explain the user defined Exceptions?

By: Karthik Viewed: 1416 times  Printer Friendly Format    

Answer: User defined Exceptions are the separate Exception classes defined by the user for specific purposed. An user defined can created by simply sub-classing it to the Exception class. This allows custom exceptions to be generated (using throw) and caught in the same way as normal exceptions.


class myCustomException extends Exception {
     // The class simply has to exist to be an exception 

Most Viewed Articles (in Interview )

What is Deployment Descriptor?

What is Collection API?

Interview Question: How do I install Struts?

Interview Question: What is the difference between find and select methods in EJB?

Question: How is the MVC design pattern used in Struts framework?

Why J2EE is suitable for the development distributed multi-tiered enterprise applications?

What is the difference between jsp:forward and response.sendRedirect(url),?.

What is JSP Scriptlet?

Interview Question: How is the MVC design pattern used in Struts framework?

Interview Question: Who makes the Struts?

Interview Question: Why do we need Struts?

Interview Question: Where can I get a copy of Struts?

Interview Question: Does Struts include its own unit tests?

Interview Question: What about JSTL and JavaServer Faces ?

Interview Question: Can I invoke Runtime.gc() in an EJB?

Latest Articles (in Interview)

Comment on this tutorial