Visibility of Instance Constructors

For technical reasons the system declares the instance constructor of a class in the public visibility area; it is therefore theoretically visible to every user. However, an instance constructor is only executed during the creation of an object of this class using CREATE OBJECT. Therefore the instance constructor is only visible to those users of a class that can also create objects of this class.

The CLASS statement additions CREATE PUBLIC|PROTECTED|PRIVATE specify, whether every user, only the inheriting class, or even only the class itself can create objects of this class. In so doing, these additions implicitly determine the actual visibility of the instance constructor:

This has the following important consequence:

If a class was defined using CREATE PRIVATE, only the class itself can instantiate itself. Subclasses of this class cannot even instantiate themselves, because they would have to call the superclass constructor using CALL SUPER->CONSTRUCTOR (see also Inheritance and Instance Creation).