Monkey Documentation

Keyword Const

Declares a constant value.

Syntax

Description

Const Identifier:Type = Expression

Const Identifier:= Expression

Description

The Const keyword declares a constant value of a given type.

The alternative syntax provided allows the variable's type to be deduced from the expression.

See also

Local | Global | Field
Language reference

Example

Const EXAMPLE:Int = 100
Const NAME:String = "Bill"