02 Explicit types and assignment
A binding gives a value a name and a definite static type.
norm
main() {
Integer remaining = 3
String task = "Review samples"
printLine(task)
printLine(remaining)
remaining = remaining - 1
printLine(remaining)
}Output:
text
Review samples
3
2Integer remaining and String task place the type before the variable name. Each local variable is initialized when declared. Later assignment to remaining replaces its stored value and must still produce an Integer.
Try it: Assign a string to remaining and read the compiler's type diagnostic.
Precise rules: Language Reference.