How to declare Static/Class variables, properties, functions and procedures in Delphi?
In Delphi, we do have static variables, properties, functions and procedures, but instead of the word "static" we refer the word "class". In this tutorial, I have shown the syntax of declaring the static variables, properties, functions and procedures in Delphi. We don't have to use "static" keyword while declaring the static variables and properties, just use "class" keyword. While declaring static functions and procedures, we have to use both "class" and "static" keyword. Declare a static/class variable in Delphi type TStaticDemoClass = class(TObject) public class var StaticVar: integer; end; Declare a static/class property in Delphi type TStaticDemoClass = class(TObject) private class var FStaticVar: integer; public class property StaticVar: integer read FStaticVar write FStaticVar; end; Now we can use above StaticVar variable/property anywhere in the unit like this: procedure TForm1.Button1C...