How are string and symbol different?



How are string and symbol different?..

Answer / Madhumita Lalwani

In Ruby, strings are represented by double quotes (e.g., "string"), while symbols are represented by a colon followed by an identifier (e.g., :symbol). Strings can contain multiple characters and are often used for storing text, while symbols are immutable objects that serve as identifiers for keys in hashes or constants.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

what is the difference between redirect and render in Ruby on Rails?

1 Answers  


Is it possible to build a 50% bespoke e-commerce platform hence having the ability to customize everything down the line? For example would it make sense to start coding an application on the Ruby on Rails framework but where the most complex/time consuming code pieces (e.g. shopping cart, etc) can be initially bolted on (hence diminishing development time and cost) having the ability to change them completely further down the line?

1 Answers  


Difference between argument and parameter in ruby on rails ?

1 Answers  


What is the purpose of auto_load in ruby?

1 Answers  


How many types of associations relationships does a model have?

1 Answers  


What is the functionality of Model views and controllers

2 Answers  


Who developed ruby on rails?

1 Answers  


Explain me what is the role of rails controller?

1 Answers  


What is the symbol garbage collector?

1 Answers  


What are rails validation used for?

1 Answers  


What do you understand by rails migration and what it can do?

1 Answers  


what is Cross-Site Request Forgery (CSRF) and how Rails is protected against it?

1 Answers  


Categories