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


    Question

    What is the difference between composition and

    inheritance?
    A Composition allows objects to inherit properties and methods from other objects, while inheritance allows objects to contain other objects. Correct Answer Incorrect Answer
    B Composition allows objects to be created from abstract classes, while inheritance allows objects to be created from concrete classes. Correct Answer Incorrect Answer
    C Composition allows objects to have "is-a" relationships, while inheritance allows objects to have "has-a" relationships. Correct Answer Incorrect Answer
    D Composition allows objects to reuse code, while inheritance allows objects to encapsulate data. Correct Answer Incorrect Answer

    Solution

    Composition allows objects to have "is-a" relationships, while inheritance allows objects to have "has-a" relationships.

    Practice Next
    More IT Networking Questions

    Relevant for Exams:

    ask-question

    Not sure which exam is best for you Talk to our expert

    Get My Free Call