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 non-abstract classes that derive from an abstract one must provide for implementation of all abstract methods by overriding them.

Using an abstract method in a basic class access causes a compilation 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