RE: Abstract classes and methods
RE: Abstract classes and methods
- Subject: RE: Abstract classes and methods
- From: "Smith, Bradley" <email@hidden>
- Date: Wed, 29 Aug 2001 11:24:59 +0100
This could get messy but here goes anyway: -
>
So it might be
>
helpful to review the definitions.
>
>
Virtual - Can't be instantiated which is enforced by the language.
Actually a virtual method can be invoked, unless it is also abstract (pure
in C++).
A virtual method is one which is likely to be overridden by subclasses.
>
Abstract - Might be a good candidate for sub classing. May or
>
may not be
>
virtual. Indicated by declaring the destructor virtual.
Again no. Any class with at least one abstract method *must* be subclassed.
An abstract method is always virtual (in C++)
>
Concrete - Not intended to be sub classed. Indicated by not
>
declaring the
>
destructor virtual.
True. Any class with at least one virtual method should also have a virtual
destructor.
Brad