Try OpenEdge Now
skip to main content
Object-oriented Programming
Designing Objects: Inheritance, Polymorphism, and Delegation : Class hierarchies and inheritance : Constructing an object

Constructing an object

You can construct a non-abstract class instance (object) by invoking the NEW functionon the type name of the class including any parameter list required by the specified constructor. (For more information on using the NEW function, see Creating a class instance.) As described previously (see Class hierarchies and inheritance), when an object of a subclass is instantiated at run time, it is constructed from the top super class of the class hierarchy down. Instantiating from the top down is important because the subclass can reference public and protected methods in its super class during the instantiation process, and the AVM must make sure that a super class has been constructed before the subclass invokes any of its methods.
Construction of the class hierarchy is facilitated by two ABL elements, each of which performs a different, explicit role in building the class hierarchy, SUPER statement and THIS-OBJECT statement.
* SUPER statement
* THIS-OBJECT statement