111k views
4 votes
User-Defined Exception Classes can indirectly extend the system-defined Exception class

1. True
2. False.

1 Answer

4 votes

Final answer:

User-Defined Exception Classes can indeed indirectly extend the system-defined Exception class, allowing custom exceptions a hierarchical relationship with system-defined exceptions.

Step-by-step explanation:

The statement that User-Defined Exception Classes can indirectly extend the system-defined Exception class is true. When you create a custom exception in most programming languages like Java or Python, you can extend a system-defined exception class, such as Exception in Java, either directly by extending the Exception class itself or indirectly by extending another user-defined class that inherits from the Exception class. This forms a class hierarchy where all custom exceptions ultimately inherit the properties and behaviors of the predefined Exception class.

User Zak Soliman
by
7.8k points