multiple inheritance
what is multiple inheritance ? what use of interface in multiple inheritance ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajesh PathakotiPosted Jul 23, 2014, 9:16 AM
In dotnet we have
1)Simple
2)Multi level
3)Heirarchical
4)Hybrid
but in dotnet we not having multiple inheritance means deriving a new class from several base classes.
To overcome this Interfaces are introduced.
Interface: An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/or properties. The reason interfaces only provide declarations is because they are inherited by classes and structs, which must provide an implementation for each interface member declared
Interface interface1
{
method1();
}
Interface intrface2
{
method2();
}
public class Test:interface1,interface2
{
//logic
}
And so much other uses also there
Please accept answer if it helps to you :)