Answer Posted / Shashi Kumar
Symbols in Ruby are objects that represent unique identifiers for method names, attribute names, and constant names. Unlike variables, they are immutable and have a faster lookup time because they are cached by the interpreter. They are defined using colons like :symbol_name. Variables, on the other hand, are declared using variables names such as variable_name and can hold any value.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers