`

inherited Create(AOwner); 和直接写inherited有区别吗

阅读更多

 摘自:http://zhidao.baidu.com/question/192207818.html

 

constructor a.Create(AOwner: TComponent);
begin
  inherited Create(AOwner); 和直接写inherited有区别吗 
 end;

destructor a.Destroy ;
begin
  inherited Destroy;
end;

问题补充:

什么是同名方法?

 

 

 

 

inherited Create(AOwner); 和直接写inherited有区别吗 

有区别,inherited Create是指定调用父类的Create方法,当然你也可以inherited Destory等等,
如果直接写inherited则默认以本方法名在父类中调用
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics