Constructor
Deutsch · English · Español · Suomi · Русский
The reserved word constructor belongs to object-oriented programming. Constructor is a class builder method that creates the object of that class.
Example:
// class definition
type
TKlasse = class
end;
var
// declare variable of type of class
clsKlasse: TKlasse;
begin
...
// create class
clsKlasse := TKlasse.Create;
...
end;See also
From the Free Pascal wiki, page "Constructor", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.