理解 Delphi 的类(十一) - 深入类中的方法[3] - 方法在实现时的参数省略
生活随笔
收集整理的這篇文章主要介紹了
理解 Delphi 的类(十一) - 深入类中的方法[3] - 方法在实现时的参数省略
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;typeTForm1 = class(TForm)end;TBass = classfunction Fun1(x,y: Integer): Integer; virtual; {Fun1 有 virtual 指示字}function Fun2(x,y,z: Integer): Integer; {Fun2 有三個參數、一個返回值}
end;varForm1: TForm1;implementation{$R *.dfm}{ TBass }
function TBass.Fun1(x, y: Integer): Integer; {方法實現時, 不能帶 virtual 等指示字}
beginResult := x + y;
end;function TBass.Fun2(x,y,z: Integer): Integer; {方法實現時可以只有函數名; 如果帶參數和返回值, 必須和定義時一樣}
beginResult := x + y + z;
end;end.
轉載于:https://www.cnblogs.com/del/archive/2008/01/16/1041443.html
總結
以上是生活随笔為你收集整理的理解 Delphi 的类(十一) - 深入类中的方法[3] - 方法在实现时的参数省略的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Windows Mobile 技术开发黄
- 下一篇: [转]DotNet for Symbia