Contents | Prev | Next | Index
An abstract method is a virtual method whose implementation is not defined in the class declaration in which it appears. Its definition is instead deferred to descendant classes. An abstract method in effect defines an interface, but not the underlying operation.
A method is declared abstract by using the ABSTRACT keyword. A method can only be declared abstract if it is first declared VIRTUAL. Neither class methods nor static methods nor overriding methods can be declared abstract.
Example:
TYPE
TFigure = CLASS
PROCEDURE Draw; VIRTUAL; ABSTRACT;
:
END;
An override of an abstract method is identical to an override of a normal virtual method. However, in the implementation of the overriding method, an inherited call to the abstract method is not possible.
This compiler maps abstract methods to normal Java-virtual methods with empty method bodies.
Contents | Prev | Next | Index
Canterbury Pascal for JVM (Last documentation update
Sep 02, 2004)
Copyright © 1999-2004 J.Neuhoff - mhccorp.com
. All rights reserved.
Please send any comments or corrections to
neuhoff@mhccorp.com