RAD Studio
ContentsIndex
PreviousUpNext
Overriding Methods

Overriding a method means extending or refining it, rather than replacing it. A descendant class can override any of its inherited virtual methods. 

To override a method in a descendant class, add the directive override to the end of the method declaration. 

Overriding a method causes a compilation error if

  • The method does not exist in the ancestor class.
  • The ancestor's method of that name is static.
  • The declarations are not otherwise identical (number and type of arguments parameters differ).

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!