4
Reply

Q. Is it possible to achieve a mechanism like multiple inheritance in c# without using interface ?

    No

    to overcome mulitple inheritance we can use only interface

    No

    Yes it is possible in c# for more details see below example.using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace LearningPractice {class MultipleInheritance{// Listing 1 : FamilyClasspublic class FamilyClass{public FamilyClass(){ }protected void GetFamilyName(){}}// Listing 2 : GrandClasspublic abstract class GrandClass{protected int age;protected string name;public GrandClass(){}public void GetGrandName(){}protected void GetGrandAge(){}}// Listing 3 : ParentClasspublic class ParentClass:FamilyClass{private void GetMotherName(){}// GrandClasspublic class ChildClass:GrandClass{public ChildClass(){ }public void ChildMethod(){ParentClass plsClass = new ParentClass();GetGrandName(); // GrandClassGetGrandAge(); // GrandClassplsClass.GetMotherName(); // Parent ClassplsClass.GetFamilyName(); // Family Class} }}static void Main1(string[] args){}} }