Shadows vs Overloads in VB.NET

后端 未结 4 1747
面向向阳花
面向向阳花 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-03 00:01

    There are three closely related concepts; overriding, shadowing and overloading.

    Overriding is when you make a new implementation for a virtual method.

    Shadowing is when you make a new non-virtual implementation for a method.

    Overloading is when you add a method with the same name but different parameters.

    All three concepts are available both in C# and VB.

提交回复
热议问题