Bird
0
0

What is true about Ruby symbols?

easy📝 Conceptual Q1 of 15
Ruby - Variables and Data Types

What is true about Ruby symbols?

AThey can be changed after creation.
BThey are immutable and unique identifiers.
CThey consume more memory than strings.
DThey are used only for arithmetic operations.
Step-by-Step Solution
Solution:
  1. Step 1: Understand symbol properties

    Ruby symbols are immutable, meaning they cannot be changed once created.
  2. Step 2: Identify uniqueness and usage

    Symbols are unique identifiers used mainly as keys or labels, not for arithmetic.
  3. Final Answer:

    They are immutable and unique identifiers. -> Option B
  4. Quick Check:

    Symbol immutability = B [OK]
Quick Trick: Symbols are immutable and unique labels in Ruby [OK]
Common Mistakes:
  • Thinking symbols can be modified like strings
  • Confusing symbols with variables
  • Assuming symbols use more memory than strings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes