Constructor

From Lazarus wiki
Revision as of 22:21, 18 March 2019 by Djzepi (talk | contribs) (Created page with "{{Constructor}} <syntaxhighlight lang="pascal" enclose="none">Constructor</syntaxhighlight> is a class builder method that creates the object of that cl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) español (es) suomi (fi) русский (ru)

Constructor is a class builder method that creates the object of that class.

The word constructor is a reserved word. Example:

// class definition
type
  TKlasse = class
  end;

var
  // declare variable of type of class
  clsKlasse: TKlasse;

begin
  ...
  // create class
  clsKlasse := TKlasse.Create; 
  ...
end;