delphi中关键字inherited
来源:互联网 发布:js删除指定tr 编辑:程序博客网 时间:2024/06/07 18:58
A是基类、B继承A、C继承B、若C函数中有inherited方法,则C中所调用的以及实现的就是全为B中的,同样,B中若有inherited,则B中调用的全为A中的。
代码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
function show:Integer;virtual;
function NumCount:Integer;virtual;
end;
TForm2 = class(TForm1)
public
function NumCount:Integer;override;
end;
TestA = class
public
function TestXX:string;virtual;
end;
TestB = Class(TestA)
public
function TestXX:String;override;
End;
TestC = class
public
function Test:string;
end;
var
Form1: TForm1;
implementation
var
X,Y : Integer;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(TestC.Create.Test);
end;
{$R *.dfm}
{ TestA }
function TestA.TestXX: string;
begin
Result := 'TestA';
end;
{ TestB }
function TestB.TestXX: String;
begin
Result := inherited TestXX + ','+'TestB'
end;
{ TestC }
function TestC.Test: string;
var
ATest : TestA;
begin
ATest := TestB.Create;
Result := ATest.TestXX;
end;
end.
- delphi中关键字inherited
- Delphi中inherited问题
- Delphi中inherited的详细用法
- 关于inherited这个关键字。
- delphi中var关键字
- @Inherited
- inherited
- inherited
- Delphi 关键字
- delphi 关键字
- Java中@Inherited注脚的运用
- Delphi中set of关键字的含义是什么
- Delphi中常用的各个关键字名称及用法
- Delphi 关键字详解
- Delphi 关键字详解
- Delphi关键字详解1
- Delphi关键字详解2
- Delphi 关键字详解
- Eclipse:批量将Java源代码文件的编码从GBK转为UTF-8
- sql server竟然可以有办法不让事件探测器显示具体的sql
- 在linux中用窗口参看文件时,如何显示当前的路径
- Exchange Server各版本OWA架构差异
- JDBC的事务控制
- delphi中关键字inherited
- KVC与KVO:
- The App Name you entered has already been used
- 单例模式singleton
- hdu 3697(贪心+部分枚举)
- 字符雨
- NSTimer的暂停和继续
- 将View的内容映射成Bitmap
- ajax请求json格式的数据,在经过interceptor时出现JSONException