Abstract Methods

When the declaration of an instance method contains the Abstract modifier, this method is named abstract. Abstract methods are implicitly virtual, so the Virtual modifier cannot be used when declaring an abstract method.

An abstract method declaration introduces a new virtual method but does not describe implementation of this method. Abstract method declarations are only permitted in abstract classes. All not-abstract classes that derive from an abstract one are to provide for implementation of all abstract methods by redetermining them.

Using an abstract method in a base access causes a compile error.

An abstract method declaration is permitted to override a virtual method.

Example

Abstract Class AbstractMethod
    Abstract Public Sub Test();
    Abstract Protected Function Run(): boolean;
End Class;

Class Sample: AbstractMethod
    b: boolean;
    
    Public Override Sub Test();
    Begin
        
    End Sub;
    
    Protected Override Function Run(): boolean;
    Begin
        Return b;
    End Function;
    
End Class;

See also:

Methods