+ 2
Why a constant is called constant "variable"
its wrong please correct it
6 Antworten
+ 14
You can change/redefine a constant in Ruby though. You'll just get a warning to notify you about it.
+ 12
Constants are variables that can't be changed.
+ 10
constant variables are variables though. They just can not be changed once they are set but you can set them to anything. Thus they are a constant variable.
const x = 5 is a constant variable opposed to say the number 5, which is a literal constant.
+ 5
@Pegasus: Only if you attempt to change them during runtime. Changing the value before runtime is perfectly valid.
+ 4
Altering then might return an error too
+ 3
@jay thanks