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
When are self.up and self.down methods used?
Explain about Dig, Float and Max?
what is the difference between new, save and create?
What are models in rails?
Explain me what is the naming convention in rails?
what is the difference in scope for these two variables: @@name and @name?
Tell me what is polymorphic association in ruby on rails?
What is the Install rail package?
What is the architecture of Model views and controllers
How to find second max element from database ?
Explain the importance of yield statement in rails.
What are the types of caching used in rails, what are they?
What is the difference between delete and destroy ?
How is direct different from render?
Explain about restful architecture?