OO Design

  • Thread starter Thread starter Ali Elhamdi
  • Start date Start date
A

Ali Elhamdi

In C#, Can I inherit from an abstract class and and interface at the same
time?

Ali
 
Sure, why not.

Something like
public class MyClass : MyAbstractClass, ISomeInterface{
...
}

The compiler would have been able to validate this for you.
 
In C#, Can I inherit from an abstract class and and interface at the same
time?

Ali

Yes. A C# class can inherit from one base class and can implement 0 to
many interfaces.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top