user1765862
user1765862

Reputation: 14155

Class which inherits from one base and many interfaces

Quick question: In c# can one class implement one base class and many interfaces?

for example

public MyCar : CarBase, ICar, ISomething
{
   ...
}

Thanks

Upvotes: 0

Views: 57

Answers (2)

kmatyaszek
kmatyaszek

Reputation: 19296

Yes, you can do this.

Here is good article:

http://msdn.microsoft.com/en-us/library/ms173149.aspx

Upvotes: 1

Christian Westman
Christian Westman

Reputation: 3005

yes this is fine, as long as the class and/or baseclass implements whatever all the interfaces declares.

Upvotes: 4

Related Questions