Multiple Inheritance

Multiple Inheritance is a feature of object-oriented concept where a class can inherit from more than one classes. In simple terms, if a child class having multiple parent then that is known as Multiple Inheritance. In c# Multiple Inheritance is not possible when it comes to class. We going to study something called Interface in upcoming articles where we'll discuss this topic in detail.

CODE

EG 1 . Creating 2 classes called Rectangle and Circle. Inheriting both to a new class called sampleClass

class Rectangle {
    public double length, width;
    public double Area() {
        return length * width;
    }
}

class Circle {
    public double radius;
    public double Area() {
        return Math.PI * radius * radius;
    }
}

class sampleClass : Rectangle, Circle {

}