Delphi Programming

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

Constructor

By Zarko Gajic, About.com

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

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

  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.