Atul Warade
Why we need Inheritance?

Why we need Inheritance? Because at the starting of programming we dont have any concept like inheritance that time as well we can acheive our goals without using inheritance then why we need inheritance?

By Atul Warade in .NET on Jun 26 2020
  • Swapnil
    Jul, 2020 4

    Inheritance mainly used for code reuseability. which make method overrides possible.

    For example:

    Suppose you have made a class which perform some calculation later on you want to use this calculation (and you want some changes in calculations part) so instead of creating object of that class you can inherit and that class.

    1. If you create of object of that class using ABC a = new ABC() like y0u can't override the existing features.
    2. so when you want existing feature with minimal changes then inheritance will help you.
    3. Also helpful when you want to provide basic features to new classes.

    • 2

Most Popular Job Functions


MOST LIKED QUESTIONS