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:

    Unlike any other visual image, a photograph is not a rendering, an imitation or an interpretation of its subject, but actually a trace of it. No painting or drawing, however naturalist, belongs to its subject in the way that a photograph does.
    John Berger (b. 1926)

    The basic essential of a great actor is that he loves himself in acting.
    Charlie Chaplin (1889–1977)

    Mental events such as perceivings, rememberings, decisions, and actions resist capture in the net of physical theory.
    Donald Davidson (b. 1917)