-2

I am trying to achieve Multiple Inheritance in C#. Or Any alternative way to achive Multiple Inheritance. Can anyone help me ? Thanx in advance.

0

1 Answer 1

2

Interfaces are a nice alternative. Essentially, an interface specifies what methods and properties must be implemented in a class that implements the interface. Sorry if that was confusing. Look here for more: https://msdn.microsoft.com/en-us/library/87d83y5b.aspx

Essentially, an interface would say that any class that uses this interface must implement Foo() and Bar(), but the interface would have no implementation. Rather it would be the responsibility of the class that uses the interface to implement those methods.

Interfaces can be a great tool depending on what you are looking for.

Sign up to request clarification or add additional context in comments.

2 Comments

Any other alternative
what are you looking for You could do what is called a composite (or whatever they are called) essentially just a variable of one class type within another class

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.