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:

    “The chess pieces are the block alphabet which shapes thoughts; and these thoughts, although making a visual design on the chess-board, express their beauty abstractly, like a poem.... I have come to the personal conclusion that while all artists are not chess players, all chess players are artists.”
    —Marcel Duchamp (1887–1968)

    “It seems to me that our three basic needs, for food and security and love, are so mixed and mingled and entwined that we cannot straightly think of one without the others. So it happens that when I write of hunger, I am really writing about love and the hunger for it, and warmth and the love of it and the hunger for it ... and then the warmth and richness and fine reality of hunger satisfied ... and it is all one.”
    —M.F.K. Fisher (b. 1908)

    “Hard times accounted in large part for the fact that the exposition was a financial disappointment in its first year, but Sally Rand and her fan dancers accomplished what applied science had failed to do, and the exposition closed in 1934 with a net profit, which was donated to participating cultural institutions, excluding Sally Rand.”
    —For the State of Illinois, U.S. public relief program (1935-1943)