A
André
Hi,
i'm learning working with classes.
In class "classbase1", i defined an overridable function. In the class
"subclass1", i defined the same function with 'Overrides'.
In class "classbase2", i defined the same function and in the class
"subclass2", i defined the same function with 'Overloads'.
Result: i get the same output.
My question is: what's the difference between the two approaches? Is one
better than the other? In which cases?
Thanks
André
Public Class classbase1
Public Overridable Function myfunction() As String
Return "start"
End Function
End Class
Public Class subclass1
Inherits classbase1
Public Overrides Function myfunction() As String
Return "end"
End Function
End Class
-------------------------------------------------
Public Class classbase2
Public Function myfunction() As String
Return "start"
End Function
End Class
Public Class subclass2
Inherits classbase2
Public Overloads Function myfunction() As String
Return "end"
End Function
End Class
i'm learning working with classes.
In class "classbase1", i defined an overridable function. In the class
"subclass1", i defined the same function with 'Overrides'.
In class "classbase2", i defined the same function and in the class
"subclass2", i defined the same function with 'Overloads'.
Result: i get the same output.
My question is: what's the difference between the two approaches? Is one
better than the other? In which cases?
Thanks
André
Public Class classbase1
Public Overridable Function myfunction() As String
Return "start"
End Function
End Class
Public Class subclass1
Inherits classbase1
Public Overrides Function myfunction() As String
Return "end"
End Function
End Class
-------------------------------------------------
Public Class classbase2
Public Function myfunction() As String
Return "start"
End Function
End Class
Public Class subclass2
Inherits classbase2
Public Overloads Function myfunction() As String
Return "end"
End Function
End Class