---
title: "Explain the user defined Exceptions?"  
description: "Explain the user defined Exceptions?"  
author: "Amit Singh"  
published: 2011-01-29  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/341/explain-the-user-defined-exceptions  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# Explain the user defined Exceptions?

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. \
Example:\
class myCustomException extends Exception {\
// The class simply has to exist to be an exception \
} \

## Answers

### Answer by Amit Singh

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. \
Example:\
class myCustomException extends Exception {\
// The class simply has to exist to be an exception \
} \


---

Original Source: https://www.mindstick.com/interview/341/explain-the-user-defined-exceptions

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
