is c#.net supports multiple inheritance?

Answer Posted / jagan

hai friends,
we can achieve this multiple inheritence through
interfaces..
ex:interface I1
{
void add();

}
interface I2
{
void add();
}

class sample:I1,I2
{
I1.add()
{
console.write("this is add method");
}
I2.add()
{
console.write("this is del method");
}
}

//main()
{
I1 i1=new sample();
i1.add();
I2 i2=new sample();
i2.add();
}
}

here we can achieve multiple inheritence and we can avoid
the naming conficts..hope it will be usefull ........

Is This Answer Correct ?    24 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?

754


What is the purpose of enumerable class in .net?

835


Explain the main components in .net?

769


Tell us what is a sealed class?

745


How to implement datagrid in.net? How would you make a combo-box appear in one column of a datagrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for datagrid methods. What is the access specifier used for that methods in the code behind file and why?

745


Explain re-clarification of object based in .net?

733


Explain how to stop a thread?

779


How can I get at the win32 api from a .net program?

758


What is implement a generic action in webapi?

934


Do you know what is linq?

795


What are the challenging issues you have faced in implementation project/Maintainance project in .net Functionality? How you have overcome that issue?

4800


How to create multiple inheritance in c#, with example?

758


What is alias ? Is it used in .Net ?

822


What method do you use to explicitly kill a users session? How?

719


Explain me what is encapsulation?

734