type
TMyClass = class
strict private
class var
FX: Integer;
strict protected
// Note: accessors for class properties must be declared class static.
class function GetX: Integer; static;
class procedure SetX(val: Integer); static;
public
class property X:
Integer read GetX write SetX;
class procedure StatProc(s: String); static;
end;
You can call a class static method through the class type (i.e. without having an object reference), for example
TMyClass.X := 17;
TMyClass.StatProc('Hello');
Dostları ilə paylaş: