Constants

A constant is a class member that represents a constant value: a value that can be calculated at compile time.

constant-declaration:

attributesopt   constant-modifiersopt   Const   identifier   =   constant-expression   ;

constant-modifiers:

constant-modifier

constant-modifiers   constant-modifier

constant-modifier:

New

Public

Protected

Friend

Private

The type of a constant depends on the type of constant expression used for its declaration.

Example

Class A
    Const a1 = 1;
    Public Const a2 = 2;
    Protected Const a3 = 3;
    Friend Const a4 = 4;
    Const a5 = 5;
End Class;

Class B: A
    New Public Const a5 = 100;
End Class;

See also:

Classes