March 2000
Intermediate to advanced
576 pages
18h 13m
English
Reintroduce Directive
Method declaration; reintroduce;A derived class uses the reintroduce directive to
hide the name of a virtual or dynamic method that was declared in a
base class. Without the directive, the compiler warns you that the
derived class is hiding the ancestor’s method. Hiding, in this
context, means that you cannot call the ancestor method if you have
an object reference whose type is the derived class. Any attempt to
call the method actually calls the derived class’s
method.
The reintroduce directive, if it appears, must be
the method’s first directive.
type
TVector = class
public
procedure Add(Item: Integer); virtual;
end;
TSingleVector = class
public
// The TSingleVector.Add method hides TVector.Add, so the compiler
// warns you about this. If you are hiding the method deliberately,
// say so with the reintroduce directive.
procedure Add(Item: Single); reintroduce;
end;| Dynamic Directive, Function Keyword, Override Directive, Procedure Keyword, Virtual Directive |
Read now
Unlock full access