Sign in Join
Wiki copytemporary

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

Constructor/es

La palabra reservada constructor es parte de la programación orientada a objetos y se utiliza para inicializar una clase. Las clases simples que no requieren inicialización, no necesitan un constructor. Una clase auto-escrita que no tiene ningún constructor puede heredar el constructor de su clase principal (si tiene un constructor).

Ejemplo:

pascal
// Definición de la calse
    type
      TClase = class
    end;
    
    var 
      unaClase: TClase; // Declarar una variable del tipo TClase
    
    begin
      ...
      // Crear la clase
      unaClase := TClase.Create; // Create invoca al constructor heredado de la clase primaria
      ...
    end;

From the Free Pascal wiki, page "Constructor/es", as the Internet Archive kept it on 2023-03-20. 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.