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 is the model view controller framework used in ruby on rails?
How will be the future for ruby on rails?
How is dynamic scaffolding different from static scaffolding?
What is unit testing (in classical terms)? What is the primary technique when writing a test ?
Explain me what are the limits of ruby on rails?
What does session and cookies represent in ruby on rails?
what are the positive aspects of Rails?
What is the difference between false and nil in ruby?
What is the difference between save and save?
Do you know what is rake in rails?
What are the various changes between the rails version 2 and 3?
What is the importance of rjs?
what is the role of Rails Controller?
how you define Instance Variable, Global Variable and Class Variable in Ruby?
Tell me what is rails migration?