Can you please explain what is the difference between string and symbol?
Answer / Asha Rani
In Ruby, a String represents a sequence of characters, while Symbol represents an immutable identifier. Strings are used for storing textual data, whereas symbols are often used as keys in hashes.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can you call a private method outside a ruby class using its object?
Explain about Class variable and global variable?
Ruby support single inheritance/multiple inheritance or both?
what is the purpose of the rakefile available in the demo directory in ruby?
How do you handle exceptions in ruby code?
Tell me how you define instance variable, global variable and class variable in ruby?
Are numeric objects mutable in ruby?
Explain some differences between ruby and python.
Mention what is the command to create a migration?
How does a symbol differ from a string?
What is request.xhr?
What is the difference between #== and #eql??