@jyeer
Here's an example that answers the question:
program human;
{$mode delphi}{$H+}
type
THuman = class
private
var Finstances:integer;static; // in fpc the same as class var Finstances.
public
constructor create;
destructor destroy; override;
class property instances:integer read Finstances;
end;
constructor THuman.create;
begin
inherited;
inc(Finstances);
end;
destructor THuman.Destroy;
begin
dec(Finstances);
inherited;
end;
var
a,b,c,d:THuman;
begin
writeln(THuman.Instances);
a := THuman.create;
writeln(THuman.Instances);
b := THuman.create;
writeln(THuman.Instances);
c := THuman.create;
writeln(THuman.Instances);
d := THuman.create;
writeln(THuman.Instances);
d.free;
writeln(THuman.Instances);
c.free;
writeln(THuman.Instances);
b.free;
writeln(THuman.Instances);
a.free;
writeln(THuman.Instances);
end.
As you can see Almindor was wrong with his assumptions, but his (two) was helpful to you.
If you must have full Delphi compatibility (XE+!) , compile in Delphi too, replace
var Finstances:integer;static;
with
class var Finstance:integer;