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 / neeraj tyagi

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestApp
{
class MultipleInheritance : first, Isecond
{
Isecond objsecond = new second();

#region Isecond Members

public void secondfunction()
{
objsecond.secondfunction();
}

#endregion
}
class first
{
public first()
{
}

public void firstfunction()
{
Console.WriteLine("First funciton called");
}
}
interface Isecond
{
void secondfunction();
}
class second : Isecond
{
public second()
{
}

public void secondfunction()
{
Console.WriteLine("Second function called");
}
}

class Program
{
static void Main(string[] args)
{
//multiple inheritance
MultipleInheritance obj = new MultipleInheritance();
obj.firstfunction();
obj.secondfunction();

Console.ReadLine();
}
}
}

Is This Answer Correct ?    47 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are All kind of access specifiers for a class and for methods

1123


What is type cast in C#?

1041


What does void mean in c#?

1037


What is difference between the "throw" and "throw ex" in .net?

1042


What is the difference between wrapper class and primitive?

907


In which situation(s), the use of "Delegate" is a good idea?

1019


Does hashset allow duplicates c#?

1042


Are c# destructors the same as c++ destructors?

1220


What is a multi line comment?

1003


Is java better than c sharp?

1016


Are multiple data types stored in System.Array?

1258


What is a multicast delegate in c#?

1034


What are the features of c#?

980


What is the use of getcommandlineargs() method in c#.net?

1022


What is the differences between datagrid, datalist and repeater in .net?

1064