A
Amin Sobati
Hi,
I have two classes. Class2 inhertis Class1:
-----------------------------
Public Class Class1
Public Overridable Sub MySub()
End Sub
End Class
Public Class Class2
Inherits Class1
Public Overrides Sub MySub()
End Sub
End Class
-----------------------------
When I write MySub with another signature in Class1, MySub in Class2 becomes
underlined and indicates an error:
-----------------------------
Public Class Class1
Public Overridable Sub MySub()
End Sub
Public Overridable Sub MySub(ByVal i As Int16)
End Sub
End Class
Public Class Class2
Inherits Class1
Public Overrides Sub MySub()
End Sub
End Class
-----------------------------
I know that I can fix it by adding Overloads keyword to MySub in Class2, but
I want to know the reason that why it's not possible to override it without
overloading?
Any help would be greatly appreciated.
Amin
I have two classes. Class2 inhertis Class1:
-----------------------------
Public Class Class1
Public Overridable Sub MySub()
End Sub
End Class
Public Class Class2
Inherits Class1
Public Overrides Sub MySub()
End Sub
End Class
-----------------------------
When I write MySub with another signature in Class1, MySub in Class2 becomes
underlined and indicates an error:
-----------------------------
Public Class Class1
Public Overridable Sub MySub()
End Sub
Public Overridable Sub MySub(ByVal i As Int16)
End Sub
End Class
Public Class Class2
Inherits Class1
Public Overrides Sub MySub()
End Sub
End Class
-----------------------------
I know that I can fix it by adding Overloads keyword to MySub in Class2, but
I want to know the reason that why it's not possible to override it without
overloading?
Any help would be greatly appreciated.
Amin