📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    What is the main purpose of Inheritance in

    OOP?
    A To hide implementation details. Correct Answer Incorrect Answer
    B To allow objects to take on many forms. Correct Answer Incorrect Answer
    C To create new classes by reusing, extending, and modifying the behavior of existing classes. Correct Answer Incorrect Answer
    D To bundle data and methods into a single unit. Correct Answer Incorrect Answer
    E To define a contract for class behavior. Correct Answer Incorrect Answer

    Solution

    Inheritance is a mechanism that allows a new class (subclass/derived class) to inherit properties and behaviors (fields and methods) from an existing class (superclass/base class). This promotes code reusability and establishes an "is-a" relationship.

    Practice Next
    ask-question