Sign in Join
Wiki copytemporary

Revision 3 of 3, by WikiArchive on 11-4-2026. The page as it is now.

Constructor

The reserved word constructor belongs to object-oriented programming. Constructor is a class builder method that creates the object of that class.

Example:

pascal
// 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.