第一个类

 

View Code
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.

 

posted on 2011-06-29 19:16  cnby  阅读(283)  评论(0编辑  收藏  举报