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:
“Man you can define; but the true essence of any man, say, for instance, of Abraham Lincoln, remains the endlessly elusive and mysterious object of the biographers interest, of the historians comments, of popular legend, and of patriotic devotion.”
—Josiah Royce (18551916)
“The sensitivity of men to small matters, and their indifference to great ones, indicates a strange inversion.”
—Blaise Pascal (16231662)