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
Who designed active record in rails?
What can Rails Migration do?
What is the function of orm in ruby on rails?
What is bundler?
What are the different types of association relationships that exist?
What is the role of mvc architecture in ruby on rails?
List out the few features of Ruby?
what is the function of garbage collection in Ruby on Rails?
Do you know what is “yield” in ruby on rails?
What is the difference between symbol and string?
What is Rails?
How is visibility of methods changed in ruby (encapsulation) ?
In how many ways you can create rails layout http response.
what is the difference between Dynamic and Static Scaffolding?
What is rails migration? What can it do?