delphi 关于构造方法的重写


本文整理自网络,侵删。

 
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

  end;





  THello=class
  public

    FStr:string;
  public
    constructor Hello;
      

  end;  



var
  Form1: TForm1;

implementation

{$R *.dfm}

{ THello }

constructor THello.Hello;
begin
  FStr:='Hello';

end;

procedure TForm1.Button1Click(Sender: TObject);
var
  He:THello;
begin
  HE:=THello.Hello;
  ShowMessage(He.FStr);
end;

end.

相关阅读 >>

Delphi firemonkey 图片显示拉伸不变形

Delphi bytestofile

Delphi hex --> string

Delphi trayicon1 托盘气泡提示

Delphi 自定义colorbox只显示指定颜色项目 colorbox显示中文颜色名称

Delphi编程启动服务停止服务新建服务的方法

Delphi处理http请求自定义header

Delphi隐藏进程

Delphi spcomm串口控件的例程

Delphi 进程保护

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...