Inheriting from 2 Interfaces

  • Thread starter Thread starter C.E.O. Gargantua
  • Start date Start date
C

C.E.O. Gargantua

Is it possible for a class to inherit from two interfaces?

When I try to add a second interface, and compile, the error is:


type in interface list is not an interface


related to the second interface.

If I remove the first interface, and compile with just the second, it
succeeds.



--
Texeme
http://texeme.com

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
 
It is possible to inherit from (zero or one base class) + (zero to many
interfaces).

Therefore, if the second item in your interface list is a base class, it
won't compile.

Could this be the problem?

If not, could you post some code to demonstrate the problem?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Ok, yes that was it.

I was using two interfaces.

I assigned each to one of two abstract classes.

Then I tried to derive a class from both class and the interfaces.

What I did is keep the two interfaces, and derive the abstract class
from them. Then I derive a set of classes from the one abstract class.

Thanks Nick!

It is possible to inherit from (zero or one base class) + (zero to many
interfaces).

Therefore, if the second item in your interface list is a base class, it
won't compile.

Could this be the problem?

If not, could you post some code to demonstrate the problem?


--
incognito...updated almost daily
http://kentpsychedelic.blogspot.com

Texeme Textcasting Technology
http://texeme.com
 
Back
Top