variable in ruby

Variables are temporal space for assigning a value in programs.It is like when we assign value in some variable in algebraic equation back in schools.In ruby we can assign any value in to variable.

Here x = 10 that means a value of 10 is assigned to variable x and y is assigned a value of 20.When a variable assigned with a particular type of object the variable also act a like type of that object so when we call "x.class" it will return fixnum. When we call variable that is not initialized,it will return with message uninitialized local variable z.

No comments:

Post a Comment


installing perl dancer in ubuntu

For installing perl dancer you need curl utility for installing curl ,   sudo apt-get install curl Now we can install Perl-Dancer by thi...