New methods brought by Visual Basic.NET (II.)

Source: Internet
Author: User
New methods brought by visual Visual Basic.NET (ii)

Inheritance of

For Visual Basic, support for inheritance is most needed. Development in the Internet age requires rapid set-up
and a massive reuse. Visual Basic now contains a complete set of inheritance, including visual window inheritance.
Developers can create inheritance from an existing class by using a new keyword Inherits.

Class1
Function GetCustomer ()
...
End Function

Class2
Inherits Class1
Function getorders ()
...
End Function

The inherited section supports all inherited attributes. The instances of the class support the methods and interfaces of all base classes. Of course, instances of classes can also
Extends the methods and interfaces of the base class.

An instance of a class can also overload a method defined in a base class by using the keyword Overrides. To reduce programming errors, Visual
Basic prevents you from overloading a function incorrectly; This function is allowed only if it is declared as "Overridable" (Can be overloaded).

can be overloaded

Visual Basic now allows the overload of the function, which gives the programmer the function and procedure to create different versions, which have the same name,
There are different types of parameters. When you have created an object model for the operation of a data, and another operation is different from its only
is a different type of data, overloading is particularly useful. For example, a process that can display a variety of different types of data can be:

Overloads Sub Display (TheChar as Char)
...
Overloads Sub Display (Theinteger as Integer)
...
Overloads Sub Display (thedouble as Double)

Without overloading, you have to create a different name for each process, or a variant type of argument that overloads support many explicit
and an effective way to deal with a variety of data types.

Parameter creation

Parameter creation allows you to create an instance of a new class with parameters for the new instance. The creation tool is object based programming, using the instance
Creates a tool that allows user-defined structure codes to be used as parameters. It allows a new object instance to be created in a single expression and
Initialized to simplify the client's code.





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.