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 游戏是如何检测到有od等调试工具的

Delphi 字符串、文件路径 排序算法

Delphi system 中的数学函数

Delphi中bitmap位图与base64字符串相互转换

Delphixe4 版本中,已针对移动平台 引入了 arc 模型

Delphi stringgrid中回车换行

Delphi 检测程序有没有被dll注入的代码

Delphi 获取memo的行数与列数

Delphi datasnap stream 传递大数据

Delphi 路径有空格调用批处理

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



打赏

取消

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

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

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

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

评论

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