5.2 Abstract and sealed objects

An object can be declared as sealed. In that case, it is not possible to declare a descendent object. The compiler will return an error if it encounters a declaration of a descendent:

  TMyClass = object Sealed
    x : integer;

  TMyClass2 = object(TMyClass)
    Y : Integer;


This will result in the following error:

Error: Cannot create a descendant of the sealed class "TMyClass"

An abstract class is a class that cannot be used directly. Instead, a descendent class must always be used. However, for Delphi compatibility, the compiler ignores this directive.