[fpc-pascal] override or virtual override

Sven Barth pascaldragon at googlemail.com
Mon May 5 08:05:47 CEST 2014


Am 05.05.2014 05:09 schrieb "Xiangrong Fang" <xrfang at gmail.com>:
>
> Hi All,
>
> Is the property of "virtual" inherited? i.e. if a method in parent class
is virtual, same method in child class is also virtual, right?
>
> TBase = class
> public
>   destructor Destroy; override; //<-- is this enough
>   destructor Destroy; virtual; override; //or this to ensure it is still
virtual?
> end;

"override" is an implicit "virtual" as long as the parameter lists of both
methods are the same.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140505/df009e12/attachment.html>


More information about the fpc-pascal mailing list