B
Ben
Hi,
i defined a function in the base class 'ford' and the same function (with
different output) in subclass "peugeot".
I first put 'Overridable function' in the base class and 'Overrides
function' in the subclass.
It works. Then i removed them in both classes, like here below:
Public Class ford
.....
Public Function tuut() As String
Return "this is function of class ford"
End Function
End Class
Public Class peugeot
Inherits ford
Public Sub New()
....
End Sub
Public Function tuut() As String
Return "this is function of class peugeot "
End Function
End Class
and it still works, giving the same result ("this is function of class
peugeot").
My question is: why shoud i use in class ford: Public overridable Function
tuut() As String
and in class peugeot: Public overrides Function tuut() As String because
with or without, it gives the same output in code-behind with this:
Label1.Text = peugeot.tuut?
Thanks
Ben
i defined a function in the base class 'ford' and the same function (with
different output) in subclass "peugeot".
I first put 'Overridable function' in the base class and 'Overrides
function' in the subclass.
It works. Then i removed them in both classes, like here below:
Public Class ford
.....
Public Function tuut() As String
Return "this is function of class ford"
End Function
End Class
Public Class peugeot
Inherits ford
Public Sub New()
....
End Sub
Public Function tuut() As String
Return "this is function of class peugeot "
End Function
End Class
and it still works, giving the same result ("this is function of class
peugeot").
My question is: why shoud i use in class ford: Public overridable Function
tuut() As String
and in class peugeot: Public overrides Function tuut() As String because
with or without, it gives the same output in code-behind with this:
Label1.Text = peugeot.tuut?
Thanks
Ben