Type Annotations
Adding : Type after a variable name explicitly annotates the variable's type. Type annotations tell the compiler what type of data this variable should hold.
If type annotation is omitted, the compiler will automatically infer the type based on the initial value. Both approaches have their advantages: explicit annotation makes type relationships clearer, while type inference makes code more concise. When the type context is clear, omitting annotation is recommended.
The code on the right shows three variable declarations with type annotations. Type annotation affects the type inference of literals: 95 would normally be inferred as Int64, but when annotated as Int32, it becomes an Int32 value. Try changing Int64 on line 2 to Bool and see what error the compiler reports.