multiple inheritance ??

  • Thread starter Thread starter cmrchs
  • Start date Start date
C

cmrchs

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...
 
Chris C said:
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
 
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 C ([email protected]) wrote in message news: said:
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/
 
Back
Top