+ 1
What is the difference between Variables and Constants?
3 Antworten
+ 11
Variables can be constant or not.
If you are declaring a constant variable, this means you can't change its value after declaring it.
+ 1
Variables and Constants are "Variables", the difference between a Variable and a Constant is that once you declare it a Constant it won't be able to change it's value by any othere method you will write or by any other code.
It's usually used for mathematical constants like "pi" or "e" or even in most (of course not all) games the value for gravity.
+ 1
A variable is a dynamic entity(it can be changed by need).
A constant is a static entity(it can not be changed).