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:
“If thinking is like perceiving, it must be either a process in which the soul is acted upon by what is capable of being thought, or a process different from but analogous to that. The thinking part of the soul must therefore be, while impassable, capable of receiving the form of an object; that is, must be potentially identical in character with its object without being the object. Mind must be related to what is thinkable, as sense is to what is sensible.”
—Aristotle (384322 B.C.)
“Habit is a second nature that destroys the first. But what is nature? Why is habit not natural? I am very much afraid that nature itself is only a first habit, just as habit is a second nature.”
—Blaise Pascal (16231662)