Asked by jordan lewis on May 25, 2024
Verified
When defining your own exception class,you extend an existing exception class.This is an example of:
A) polymorphism
B) encapsulation
C) inheritance
D) all of the above
Exception Class
A type of class in object-oriented programming that is used to handle or represent errors and other exceptional events that occur during program execution.
Inheritance
A fundamental concept in object-oriented programming, allowing a class (subclass) to inherit properties and methods from another class (superclass), promoting reusability.
- Understand how to create and use custom exception classes through inheritance.
Verified Answer
MZ
Miguel ZepedaMay 27, 2024
Final Answer :
C
Explanation :
When defining your own exception class, you use inheritance to extend an existing exception class provided by the language. Polymorphism and encapsulation are not directly related to defining exception classes.
Learning Objectives
- Understand how to create and use custom exception classes through inheritance.