Constructor (object-oriented Programming) - Visual Basic .NET

Visual Basic .NET

In Visual Basic .NET, constructors use a method declaration with the name "New".

Class Foobar Private strData As String ' Constructor Public Sub New(ByVal someParam As String) strData = someParam End Sub End Class ' code somewhere else ' instantiating an object with the above constructor Dim foo As New Foobar(".NET")

Read more about this topic:  Constructor (object-oriented Programming)

Famous quotes containing the words visual, basic and/or net:

    Dialogue should simply be a sound among other sounds, just something that comes out of the mouths of people whose eyes tell the story in visual terms.
    Alfred Hitchcock (1899–1980)

    Insecurity, commonly regarded as a weakness in normal people, is the basic tool of the actor’s trade.
    Miranda Richardson (b. 1958)

    There is a potential 4-6 percentage point net gain for the President [George Bush] by replacing Dan Quayle on the ticket with someone of neutral stature.
    Mary Matalin, U.S. Republican political advisor, author, and James Carville b. 1946, U.S. Democratic political advisor, author. All’s Fair: Love, War, and Running for President, p. 205, Random House (1994)