1. Home
  2. Computing & Technology
  3. Delphi Programming

Constructor

By , About.com Guide

Definition: A constructor is a special method that creates and initializes instance objects. The declaration of a constructor looks like a procedure declaration, but it begins with the reserved word constructor.

A class can have more than one constructor, but most have only one. It is conventional to call the constructor Create.

To create an object, call the constructor method on a class type.

type
  TCar = Class
   constructor Create;
  end;

...

  car := TCar.Create;

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Getting Started with Delphi
  5. Delphi Programming Glossary
  6. Constructor - Glossary - Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.