JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Overloading, Overriding, and Shadowing

Overloading, overriding, and shadowing are also important concepts in Visual Basic OOP. All three of these techniques allow you to create multiple members with the same name. Here's how they work, in overview:

  • Overloaded-members provide different versions of a property or method that have the same name, but that accept a different number of parameters (or parameters of different types).

  • Overridden-properties and methods are used to replace an inherited property or method. When you override a member from a base class, you replace it. Overridden members must accept the same data type and number of arguments.

  • Shadowed-members are used to create a local version of a member that has broader scope. You also can shadow a type with any other type. For example, you can declare a property that shadows an inherited method with the same name.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor