Ruby Developer Question:
Download Job Interview Questions and Answers PDF
Tell me how Symbol is different from variables?
Answer:
Symbol is different from variables in following aspects
☛ It is more like a string than variable
☛ In Ruby string is mutable but a Symbol is immutable
☛ Only one copy of the symbol requires to be created
☛ Symbols are often used as the corresponding to enums in Ruby
☛ It is more like a string than variable
☛ In Ruby string is mutable but a Symbol is immutable
☛ Only one copy of the symbol requires to be created
☛ Symbols are often used as the corresponding to enums in Ruby
Download Ruby Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Can you list out what can Rails Migration do? | Explain me what the difference is between false and nil in Ruby? |