Try OpenEdge Now
skip to main content
Guide for New Developers
An overview of ABL : Understanding the ABL Class-based model and its members : Constructor
 

Constructor

Constructors are special methods that define initial behavior for a class, similar to internal procedures and user-defined functions in procedures.
A constructor allows you to execute behavior and initialize data members and properties during the instantiation of a class. ABL allows you to define a constructor as a named block that always begins with the CONSTRUCTOR statement and always ends with the END CONSTRUCTOR statement. A constructor must have the same name as the name of the class in which it is defined and it can only execute when the class is instantiated. A constructor can be defined with an access mode of PRIVATE, PROTECTED, or PUBLIC, where PUBLIC is the default.
A constructor can also have parameters, but no defined return type. You can define more than one constructor (overload constructors) in a class as long as the calling signature of each constructor is unique.
For more information on Object-oriented programming, see the guide OpenEdge Development: Object-oriented Programming.