Object Pascal
In Object Pascal, the constructor is similar to a factory method. The only syntactic difference to regular methods is the keyword constructor in front of the name (instead of procedure or function). It can have any name, though the convention is to have Create as prefix, such as in CreateWithFormatting. Creating an instance of a class works like calling a static method of a class: TPerson.Create('Peter').
Read more about this topic: Constructor (object-oriented Programming)
Famous quotes containing the words object and/or pascal:
“Does our ferocity not derive from the fact that our instincts are all too interested in other people? If we attended more to ourselves and became the center, the object of our murderous inclinations, the sum of our intolerances would diminish.”
—E.M. Cioran (b. 1911)
“Chance gives rise to thoughts, and chance removes them; no art can keep or acquire them.”
—Blaise Pascal (16231662)