Shadows vs Overloads in VB.NET

后端 未结 4 1749
面向向阳花
面向向阳花 2020-12-02 23:20

When we have new in C#, that personally I see only as a workaround to override a property that does not have a virtual/overridable declaration, in VB.NET we hav

4条回答
  •  隐瞒了意图╮
    2020-12-02 23:53

    Shadows is for cases where your base class is Function SomeMethod() As String and you want to have Function SomeMethod() As Integer. Basically, to change the return type.

    Overloads is for case where your base class is Function SomeMethod() As String and you want to add a parameter such as Function SomeMethod(ByVal value As Integer) As String.

提交回复
热议问题