Construct an object
- Last Updated: March 19, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
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 Create 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.