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
What is the use of $ in ruby?
What is the main difference between procs and blocks?
Mention the differences between the observers and callbacks in ruby on rails.
What is the difference between false and nil in ruby?
How many types of relationships does a model has?
How you run your rails application without creating databases?
what is sweeper in Rails?
What are gemsets in rails?
what is active record?
Where does the start_tabnav gets informations for tabs rendering in ruby rail?
What I have to do to view my project always on browser?
Explain valid and invalid in rails?
What do you mean by render and redirect_to?
Write a program to generate and run the application without the use of database
How would you create a controller for the subject?