有一个类TPerson。已知FSecondName对于每个对象都是唯一的。
type
TPerson = class(TObject)
private
FAge: Integer;
FFirstName: String;
FSecondName: String;
public
property Age: Integer read FAge;
property FirstName: String read FFirstName;
property SecondName: String read FSecondName;
constructor Create;
end;
我应该如何添加一个类字段(类似于C#中的静态字段)Persons:TDictionary(String,TPerson),其中键是SecondName,值是类TPerson的对象。
谢谢!