Sign in Join
Wiki copytemporary

Revision 2 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 the Internet Archive kept it on 2024-02-05. 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.