Bird
0
0

What does the super keyword do in Ruby?

easy📝 Conceptual Q11 of 15
Ruby - Inheritance
What does the super keyword do in Ruby?
ACreates a new instance of the parent class
BOverrides the parent class's method permanently
CCalls the parent class's method with the same name
DDeletes the parent class's method
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of super

    The super keyword is used inside a child class method to call the method with the same name from its parent class. It does not create, override, or delete methods but simply calls the parent method to reuse or extend its behavior.
  2. Final Answer:

    Calls the parent class's method with the same name -> Option C
  3. Quick Check:

    super calls parent method [OK]
Quick Trick: Remember: super calls parent method with same name [OK]
Common Mistakes:
  • Thinking super creates or deletes methods
  • Confusing super with instance creation
  • Assuming super overrides methods permanently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes