static class



static_class
Smart pascal source code
type TStatic = class static const MyConst = 'hello'; class procedure WriteLnMe; virtual; begin WriteLn('world'); end; end; type TStaticClass = class of TStatic; type TSubStatic = class(TStatic) class procedure WriteLnMe; override; begin WriteLn(MyConst + ' '); inherited; end; end; WriteLn('const = ' + TStatic.MyConst); TStatic.WriteLnMe; TSubStatic.WriteLnMe; var c: TStaticClass; c := TStatic; c.WriteLnMe; c := TSubStatic; c.WriteLnMe; {<<< RESULT - CONSOLE LOG >>> ----------------------------- const = hello world hello world world hello world ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}