How symbol is different from variables?
Answer / 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 |
Explain case statement in Ruby?
Explain the role of thread pooling in relation to the thread lifecycle in ruby?
What must you do first before you can invoke an unboundmethod object?
Explain about Class variable and global variable?
What is concatenating string in ruby. In how many ways you can create a concatenating string.
Explain Ruby exceptions?
How would you freeze an object in ruby? Can you provide a simple example?
What is the difference between “#==” and “#equal?”
What are class libraries in Ruby?
What are advantages of using ruby?
Explain about the command line options?
Explain the concepts and capabilities of garbage collection feature of Ruby?