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 difference between destroy and delete?
How are the key differences between python and ruby?
Explain the controller in rails?
how you can run Rails application without creating databases?
Explain unobtrusive javascript in rails.
What is the latest version of ruby on rails?
Write a program to show the functionality of request.xhr in ruby on rails ?
Is ruby on rails popular?
explain request/response cycle?
What is the purpose of auto_load in ruby?
When are self.up and self.down methods used?
what is Mixin in Rails?
How to serialize data with yaml?
what is the purpose of the resources method in the code snippet below?
What are the different components of rails ?