473,396 Members | 1,827 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,396 software developers and data experts.

multiple inheritance ??

Hi,

what is the syntax to inherit from an interface AND a class ?

Suppose :
interface IA
Sub F()
end interface

class B
...
end class

and I want to create a new class C inheriting from both :
class C
Implements IA _
Inherits B

Sub F() implements IA.F
End sub
end class

but I get a syntax error in the inheriting clause

Any ideas ?

Thank you

Chris

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 20 '05 #1
4 884
"Chris C" <cm****@yahoo.com> schrieb
Hi,

what is the syntax to inherit from an interface AND a class ?
You can not inherit from an interface. You can only implement an interface.
Suppose :
interface IA
Sub F()
end interface

class B
...
end class

and I want to create a new class C inheriting from both :
class C
Implements IA _
Inherits B

Sub F() implements IA.F
End sub
end class

but I get a syntax error in the inheriting clause

Any ideas ?


Remove "_"
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
On Tue, 25 May 2004 16:59:39 +0200, Armin Zingler wrote:

You can not inherit from an interface. You can only implement an interface.


While technically true, one interface can inherit from another, however.

For example:

Public Interface IBase
Function DoSomething() As Boolean
End Interface

Public Interface IDerived
Inherits IBase

Function DoSomethingElse() As Integer
End Interface

Public Class MyClass
Implements IDerived

End Class

--
Chris

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 20 '05 #3
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net">
schrieb
On Tue, 25 May 2004 16:59:39 +0200, Armin Zingler wrote:

You can not inherit from an interface. You can only implement an
interface.


While technically true, one interface can inherit from another,
however.


Yep.
--
Armin

Nov 20 '05 #4
Chris C (cm****@yahoo.com) wrote in message news:<uJ*************@TK2MSFTNGP10.phx.gbl>...
and I want to create a new class C inheriting from both :
class C
Implements IA _
Inherits B

Sub F() implements IA.F
End sub
end class

but I get a syntax error in the inheriting clause

Any ideas ?

Thank you

Chris


I just did this, actually. It's :

class C
Inherits B
Implements IA

end class

No underscore, and Inherits first.

John Fiala
jcfiala523-at-hotmail.com
http://www.livejournal.com/users/fiala_tech/
Nov 20 '05 #5

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

Similar topics

2
by: Graham Banks | last post by:
Does using multiple inheritance introduce any more performance overhead than single inheritance?
5
by: Morgan Cheng | last post by:
It seems no pattern defined by GoF takes advantage of multiple inheritance. I am wondering if there is a situation where multiple inheritance is a necessary solution. When coding in C++, should...
20
by: km | last post by:
Hi all, In the following code why am i not able to access class A's object attribute - 'a' ? I wishto extent class D with all the attributes of its base classes. how do i do that ? thanks in...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
47
by: Mark | last post by:
why doesn't .NET support multiple inheritance? I think it's so silly! Cheers, Mark
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
15
by: iKiLL | last post by:
hi all, I would like to be able to create an umbrella class for all my main global sections but I would still like to keep them all in separate file something like the below but I keep getting...
7
by: Adam Nielsen | last post by:
Hi everyone, I'm having some trouble getting the correct chain of constructors to be called when creating an object at the bottom of a hierarchy. Have a look at the code below - the inheritance...
47
by: Larry Smith | last post by:
I just read a blurb in MSDN under the C++ "ref" keyword which states that: "Under the CLR object model, only public single inheritance is supported". Does this mean that no .NET class can ever...
2
by: Paul McGuire | last post by:
On May 25, 8:37 am, Michael Hines <michael.hi...@yale.eduwrote: Here's a more general version of your testing code, to detect *any* diamond multiple inheritance (using your sample classes). --...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.