Ruby Developer Question:
Download Questions PDF

Tell me what is the difference between calling super and calling super()?

Ruby Developer Interview Question
Ruby Developer Interview Question

Answer:

A call to super invokes the parent method with the same arguments that were passed to the child method. An error will therefore occur if the arguments passed to the child method don’t match what the parent is expecting.

A call to super() invokes the parent method without any arguments, as presumably expected. As always, being explicit in your code is a good thing.

Download Ruby Developer Interview Questions And Answers PDF

Previous QuestionNext Question
What is the difference between a gem and a plugin in Ruby?Do you know what are the types of caching used in rails, what are they?