Answer Posted / abhishek shukla
Symbol refers to the same memory location where string
generates a new id every time for eg.
STRING
irb(main):019:0> "ruby".object_id
=> 24095860
irb(main):020:0> "ruby".object_id
=> 24092310
irb(main):021:0> "ruby".object_id
=> 24088760
irb(main):022:0>
SYMBOL
irb(main):022:0> :ruby.object_id
=> 102978
irb(main):023:0> :ruby.object_id
=> 102978
irb(main):024:0> :ruby.object_id
=> 102978
irb(main):025:0> :ruby.object_id
=> 102978
irb(main):026:0>
| Is This Answer Correct ? | 23 Yes | 2 No |
Post New Answer View All Answers
How to serialize data with yaml?
How can the filter methods in ruby on rails be protected?
how can you declare a block in Ruby?
Explain me what is the function of orm in ruby on rails?
what is different between activerecord::relation's count, length and size methods?
Who developed ruby on rails?
What do you understand by rails migration and what it can do?
How is direct different from render?
What is a webrick web server?
Explain what is the role of the subdirectories app/controllers and app/helpers in rails?
What is the purpose of load in ruby?
what is testing in rails?
Write a program to generate and run the application without the use of database
how can we define Ruby regular expressions?
What are generators in ruby on rails?