Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you create multiple inheritance in C#?

Answer Posted / pavankumar

C# doesn't support Multiple Inheritance,,,SO to over come this problem Interface came into picture.Interface is not a class,but it is a parent to base class.

Interface Forest
{
void Greet();
}

class Animal: Forest
{
public void Greet()
{
Console.WriteLine("Animal says Hello");
}

public void Sing()
{
Console.WriteLine("Animal Sings");
}
}

class Program : Animal,Forest
{
static void Main(string[] args)
{
Program obj = New Program();
obj.Greet();
obj.Sing();
Console.ReadLine();
}
}

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by the terms datareader object and dataset object?

1027


What are cshtml files?

949


Could you explain the difference between func vs action vs predicate?

912


Why is static constructor called first?

949


what is the index value of the first element in an array?

972


What is difference between il and dll ?

1059


Does c# support multilevel inheritance?

929


Explain About web methods and its various attributes

1039


What floating point types is supported in C#?

1078


What are the commonly used i/o classes?

1003


What is for loop in c#?

955


What is poco c#?

961


If you donot specify an access modifier for a method, what is the default access modifier?

1096


What is difference between continue and break in c#?

1012


What is the use of ienumerable?

927