第一个类
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
unit TMan;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
private
{ Private declarations }
public
{ Public declarations }
end;
TMans =class(TObject)
private
FAge:Integer; //字段 数据成员
procedure SetAge(value:Integer); //私有的成员通过属性(public)访问
public
Language:string;
Married:Boolean;
Name:String;
SkinColor:string;
constructor create;overload;
property Age:Integer read FAge write SetAge; //属性
procedure sayHello(words:PChar); //方法
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TMans }
constructor TMans.create;
begin
end;
procedure TMans.sayHello(words: PChar);
begin
end;
procedure TMans.SetAge(value: Integer);
begin
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
private
{ Private declarations }
public
{ Public declarations }
end;
TMans =class(TObject)
private
FAge:Integer; //字段 数据成员
procedure SetAge(value:Integer); //私有的成员通过属性(public)访问
public
Language:string;
Married:Boolean;
Name:String;
SkinColor:string;
constructor create;overload;
property Age:Integer read FAge write SetAge; //属性
procedure sayHello(words:PChar); //方法
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TMans }
constructor TMans.create;
begin
end;
procedure TMans.sayHello(words: PChar);
begin
end;
procedure TMans.SetAge(value: Integer);
begin
end;
end.