delphi a=class(b);a:class(b)有什么区别
答案:3 悬赏:30
解决时间 2021-01-15 22:33
- 提问者网友:疯孩纸
- 2021-01-15 15:43
delphi a=class(b);a:class(b)有什么区别
最佳答案
- 二级知识专家网友:掌灯师
- 2021-01-15 16:01
a= class(b)是类型声明,必须在type段中声明,表示a的类型信息继承自b,并且希望实现新的类方法等处理。如:
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
end;
a: b 表示a是b的类实例引用变量,一般在var或类结构的private/public中声明。
如:
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
private
ib: TButton; //表示ib是TButton的类实例引用变量
public
end;
又如:
procedure TForm1.Button1Click(Sender: TObject);
var
ib: TButton; //表示ib是TButton的类实例引用变量
begin
ib := TButton.Create(Self);
。
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
end;
a: b 表示a是b的类实例引用变量,一般在var或类结构的private/public中声明。
如:
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
private
ib: TButton; //表示ib是TButton的类实例引用变量
public
end;
又如:
procedure TForm1.Button1Click(Sender: TObject);
var
ib: TButton; //表示ib是TButton的类实例引用变量
begin
ib := TButton.Create(Self);
。
全部回答
- 1楼网友:痴妹与他
- 2021-01-15 17:43
你说的不对
- 2楼网友:你哪知我潦倒为你
- 2021-01-15 16:35
a= class(b)是类型声明,必须在type段中声明,表示a的类型信息继承自b,并且希望实现新的类方法等处理。如:
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
end;
a: b 表示a是b的类实例引用变量,一般在var或类结构的private/public中声明。
如:
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
private
ib: TButton; //表示ib是TButton的类实例引用变量
public
end;
又如:
procedure TForm1.Button1Click(Sender: TObject);
var
ib: TButton; //表示ib是TButton的类实例引用变量
begin
ib := TButton.Create(Self);
...
end;
希望对你有所帮助。
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
end;
a: b 表示a是b的类实例引用变量,一般在var或类结构的private/public中声明。
如:
type
TFoo = class(TForm); //TFoo的类型声明继承自TForm
private
ib: TButton; //表示ib是TButton的类实例引用变量
public
end;
又如:
procedure TForm1.Button1Click(Sender: TObject);
var
ib: TButton; //表示ib是TButton的类实例引用变量
begin
ib := TButton.Create(Self);
...
end;
希望对你有所帮助。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息