+ 2
It says you cannot start a variable name with capital letter but it allows its use in 'try it yourself' section..
5 odpowiedzi
+ 11
yes you can, but variable name start with capital letter in ruby means constant. you cant change its value when already initialized. same with "final" keyword in java.
+ 5
Variables are those who's value can be changed during the execution of the program. And constants are those who's values once assigned are fixed and cannot be changed during execution. And so in Ruby the variables are given name which starts with small letter and constants using capital. This is a rule of the language. If you try to change the value of constant you will get an error.
+ 4
as a variable, it is not allowed. But as a constant (which is also a subclassification of variable), it needs to start with capital letter.
+ 2
Its a constant if the variable begins with Caps
0
you can assign different values to same variable in ruby. but if the variable name starts with capital letter, it can't be changed after first assignment