在类定义时在方法前加上class代表什么意思?有加class和没加class有何区别?
类定义如下:
type
tlong=class
i:integer;
class procedure cs();
end;
class procedure tlong.cs();
begin
end;
类定义如下:
type
tlong=class
i:integer;
class procedure cs();
end;
class procedure tlong.cs();
begin
end;
A class method is a method (other than a constructor) that operates on classes instead of objects. The definition of a class method must begin with the reserved word class.
类似于c++类的静态函数