Inheritance :-

Inheritance is a process of deriving the new class from already existing class C#is a complete object oriented programming language. Inheritance is one of the primary concepts of object-oriented programming. It allows you to reuse existing code. Through effective use of inheritance, you can save lot of time in your programming and also reduce errors, which in turn will increase the quality of work and productivity. A simple example to understand inheritance in C#.

Ex 1

When the above code is compiled and executed, it produces the following result:

Total area: 35

Ex 2

results matching ""

    No results matching ""