473,378 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Inheriting from 2 Interfaces


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
Jul 21 '05 #1
2 1586
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.
--
"C.E.O. Gargantua" <us*@cord.blah> wrote in message
news:35*************@individual.net...

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

Jul 21 '05 #2

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!
Nick Malik [Microsoft] wrote:
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

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tim Haughton | last post by:
Open question - is it possible to inherit comments along with an interface or class?? For example - I have a class that implements IXPathNavigable. When VS creates te method stub for me, it...
3
by: Mark | last post by:
I have a class which is implementing an interface, but I also want to have it inherit from a base class. Can you do both with a class? If so, what's the syntax? thanks.
2
by: C.E.O. Gargantua | last post by:
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...
8
by: Anthony Williams | last post by:
Morning all, I'm having a wee problem with a project I'm working on at the moment. I'm leading my company into producing a website, based upon Web Standards, which will be created using XHTML...
2
by: Charles Law | last post by:
I want a set of controls that all have a border, like a group box. I thought I would create a base control containing just a group box from which my set of controls could inherit. Assuming that...
1
by: jbzdak | last post by:
Recently, I have been learning Java (it is one of laboratories on my department), well I know Java is awfully slow, but it is not the point that I'm interested. Java has a keyword "interface. (and...
4
by: Dan Holmes | last post by:
I am in a jam. Since C# (or the CLR) doesn't support MI i need to create either two inheritance hierarchies or have all my object inherit ultimately from MarshalByRefObject. I noticed that...
17
by: Adrian Hawryluk | last post by:
Hi all, What is everyone's opinion of const inheriting? Should the object that a pointer is pointing at inherit the constness of the pointer? Such as in the case of a class having a pointer...
1
by: adesoky | last post by:
I have a class that inherit from two interfaces, each interface has one method but the signatures of the two interfaces' methods are identical. How I can implement each method in the class...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.