Template:Computer Programming/Variables/2

The example set the variable X to the integer value of 10. The assignment statement overwrites the contents of the variable and the previous value is lost.

In some languages, before a variable can be used, it will have to be declared, where the declaration specifies the type.