RAD Studio
ContentsIndex
PreviousUpNext
Making Methods Virtual

You make methods virtual when you want different types to be able to execute different code in response to the same method call. 

If you create components intended to be used directly by application developers, you can probably make all your methods nonvirtual. On the other hand, if you create abstract components from which other components will be derived, consider making the added methods virtual. This way, derived components can override the inherited virtual methods.

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