|
-
Dec 27th, 2002, 11:51 AM
#1
Thread Starter
New Member
override confusing
i have a class like this
Public Class A
Public Overridable Sub F()
End Sub
Public Overridable Sub F(ByVal x As Integer)
End Sub
End Class
i want to inherit a class from Class A like this
Public Class B
Inherits A
Public Overrides Sub F(ByVal x As Integer)
End Sub
End Class
but i get a compile error that says
sub 'F' cannot be declared 'Overrides' because it does not override a sub in a base class.
when i rearrange Class A and change the location of the two overloaded methods it will be ok:
Public Class A
Public Overridable Sub F(ByVal x As Integer)
End Sub
Public Overridable Sub F()
End Sub
End Class
can anybody tell me why it is so?
thankX
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|