Ruby Developer Question:
Download Questions PDF

Can you please explain what is the difference between String and Symbol?

Ruby Developer Interview Question
Ruby Developer Interview Question

Answer:

They both act in the same way only they differ in their behaviors which are opposite to each other. The difference lies in the object_id, memory and process tune when they are used together. Symbol belongs to the category of immutable objects whereas Strings are considered as mutable objects.

Download Ruby Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Explain me what is the role of Rails Controller?Tell me what is the function of garbage collection in Ruby on Rails?