Class constructors
- Last Updated: January 29, 2026
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
A class constructor is a special method
that creates an instance of a class. The constructor returns an instance of the class.
A class can have more than one constructor, each with a different
parameter list. This is useful when you need to create instances in different ways for
different parts of the application. For example, you could have one Customer constructor
that takes no input parameters that is called by one part of the application. In this
case an “empty” Customer instance is created and another part of
the application initializes the data members of the Customer instance. You can also have a constructor that takes values for
the Customer when it is created. When the constructor
executes, it will populate the data members for this instance with these values.
PUBLIC so that other parts of
the application can create instances of the class.- Comparison with procedure-based programming main blocks of persistent procedures in Develop Object-oriented ABL Applications